Home > Backend Development > PHP Tutorial > Quickly load MYSQL database. Join time 2001-2-15_PHP tutorial

Quickly load MYSQL database. Join time 2001-2-15_PHP tutorial

WBOY
Release: 2016-07-13 17:25:39
Original
881 people have browsed it

Author: Xiaojian
Source: http://it.163.com/tm/010119/010119_13632.html

MySQL is a small and exquisite database server software, suitable for small (of course not necessarily small) ) application system is very ideal. In addition to supporting standard ANSI SQL statements, it also supports multiple platforms. On Unix systems, the software supports multi-threaded operation, thus achieving very good performance. For users who do not use Unix, it can run as a system service on Windows NT systems, or as a normal process on Windows 95/98 systems.
For the Windows 95/98 system operating mode, to actually create a database, type the following command in the DOS environment: mysqladmin -u root create mydb, where the -u option tells MySQL that we are using the default root user, thus creating Create a database named "mydb".
Before reading data from the MySQL database, we must first put some data into the database. At this stage, there is no easy way to do this. Unfortunately for Win32 users, if you want to do some work under DOS, you have to use the DOS window: type "MySQL" at the DOS prompt, the welcome message and the "MySQL>" prompt appear, and then type "use mydb ” means to start using our newly created database, then create the name and data structure of the data table (file), and add data to the data table. During this process, any incorrect input may cause errors, causing all previous efforts to be wasted and having to start all over again.
To avoid this situation, we need to use other methods. Here we take the employee database that everyone likes to use as an example. We can add data like this:
Copy the following text to a file and save the file in the bin directory of MySQL (I assume the file name is mydb.dump ).
CREATE TABLE employees (id tinyint(4) DEFAULT 0 NOT NULL AUTO_INCREMENT, first varchar(20), last varchar(20), address varchar(255), position varchar(50), PRIMARY KEY (id), UNIQUE id (id));


INSERT INTO employees VALUES (1,Bob,Smith,128 Here St, Cityname,Marketing Manager);
INSERT INTO employees VALUES (2,John,Roberts,45 There St, Townville,Telephonist);
INSERT INTO employees VALUES (3,Brad,Johnson,1/34 Nowhere Blvd, Snowston,Doorman);
If the text is wrapped, please make sure that each INSERT statement starts on a new line . Now, we are going to add the data to the mydb database. At the command line, type the following command:
MySQL -u root mydb You should not encounter any errors at this time. If something goes wrong, please check carefully to see if the error is caused by the wrapping of the text above. This completes the function of transmitting data tables to the database, and the operation is much more convenient

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532043.htmlTechArticleAuthor: Xiaojian Source: http://it.163.com/tm/010119/010119_13632.html MySQL It is a small and exquisite database server software. For small (of course not necessarily small) application systems...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template