1. Enter the password: ******
2.ues MySQL; using MySQL
3.show databases; show Database
4.use Register; Use the database named Register
5.show tables; Displays the tables in the Register database
6.describe user, operation on table User:
Insert into user (Username,password) VALUES ("XiaoYan", "123456"); Insert data
Insert into user (Username,password) VALUES ("FF", "123456"); Insert data
Delete from user where username= "XiaoYan";
Update user set username= "XiaoYan" where username= "FF";
select * from user; query data
7.quit; Launch
1. Displays the list of databases in the current database server:
mysql> SHOW DATABASES;
Note: MySQL library has the MySQL system information, we change the password and new users, is actually using this library to operate.
2. Display the data table in the database:
mysql> use library name;
mysql> SHOW TABLES;
3, display the structure of the data table:
mysql> DESCRIBE table name;
4. Establish the database:
mysql> CREATE database name;
5. Set up the data sheet:
mysql> use library name;
mysql> CREATE table name (field name VARCHAR (20), Field name CHAR (1));
6. Delete the database:
mysql> DROP database name;
7. Delete Data sheet:
mysql> DROP table name;
8. Empty the records in the table:
mysql> DELETE from table name;
9. Display the records in the table:
mysql> SELECT * from table name;
10. Insert a record into the table:
mysql> INSERT into table name VALUES ("HyQ", "M");
11. Update the data in the table:
mysql-> UPDATE table name SET field name 1= ' A ', field name 2= ' B ' WHERE field name 3= ' C ';
12. Load data into the data table in text mode:
mysql> LOAD DATA LOCAL INFILE "d:/mysql.txt" into table name;
13. Import the. sql File command:
mysql> use database name;
mysql> SOURCE d:/mysql.sql;
14, the command line to modify the root password:
mysql> UPDATE mysql.user SET password=password (' New password ') WHERE user= ' root ';
mysql> FLUSH privileges;
15. Display the database name of use:
mysql> SELECT DATABASE ();
16. Display the current User:
mysql> SELECT USER ();
MySQL command line client uses commands