Quickly load mySQL database (join time: 2001-2-15)

zhaozj2021-02-08  287

Author: Xiaojian Source: http: //it.163.com/tm/010119/010119_13632.html MySQL is a small size of the database server software for small (of course not necessarily small) applications is ideal. In addition to supporting standard ANSI SQL statements, it also supports a variety of platforms. On the UNIX system, the software supports multi-threaded operation, so that it can get considerable performance. For users who don't use UNIX, it can run in a system service in the Windows NT system, or run in a normal process on the Windows 95/98 system. For Windows 95/98 system operation, actually create a database, type the following command in the DOS environment: mysqladmin -u root create mydb, where the -u option tells mysql we use the default root user, this creation one name Database for "MyDB". We have to put some data in the database before reading the data from the MySQL database. At this stage, there is no easy way to do this. For Win32 users, it is very unfortunate. To do some work under DOS, you have to use the DOS window: Type "MySQL" at the DOS prompt, welcome information and "MySQL>" prompt, then type "USE MyDB ", Indicating that starting using our newly built database, then create a name and data structure of a data sheet (file), and add data to the data table. During this process, any error input may generate an error, resulting in a forefilling, and must come back from step. In order to avoid this, we need other ways. Here is the employee database that everyone likes to use as an example. We can add data to a file to copy the following text, put the file in the mysql bin directory (I assume that 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 a fold, please make sure Each INSERT statement is another line. Now we have to add data to the MyDB database. On the command line, type the following command: mysql -u root mydb

转载请注明原文地址:https://www.9cbs.com/read-1514.html

New Post(0)