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));