1. display the Database List. Show databases; At the beginning, there were only two databases: MySQL and test. The MySQL database contains the MySQL system information. We change the password and add new users to use this database for operations. 2. display the data tables in the database: Use anying; // when you open the database, show tables is no stranger to FOXBASE. 3. display the data table structure: Describe table name; 4. database creation: Create Database database name; 5. Table creation: Use Database Name; Create Table Name (field setting list); 6. Database deletion and table deletion: drop database database name; drop table name; 7. Clear the records in the Table: delete from table name; 8. display the records in the Table: Select * from table name; 9. display the Database Name of use: select database (); 10. display the current user: Select User ();
Prerequisites
Computer properties-environment variables-New-variable value input MySQL path
C: \ Program Files \ mysql \ MySQL Server 5.0 \ bin \
Step 1 first open the MySQL database creation command
Database creation:
Create Database database name;
Displays the Database List.
Show databases; Use this command to determine whether the database is successfully created. If the database is successfully created! Then proceed to the next step
Step 2
Open the command line in the Start menu and Enter cmd.
First, use the CD switch path command to switch to the SQL directory.
Cd c: \ Program Files \ mysql \ MySQL Server 5.0 \ bin \
After switching, enter the SQL File Import command
Mysql-u root-pabc123456 anying <E: \ data \ heroes. SQL
After entering the information, you can enable MySQL
2. display the data tables in the database:
Use anying; // open the database. If you have learned FOXBASE, you will not be familiar with it.
Show tables;
Determine whether the table has been imported successfully!