1. Use the show statement to find out the current database on the server: mysql> show databases;
2. Create a database mysqldata: mysql> Create Database mysqldata;
3. Go to the table: mysql> Use *** (your table name );
4. create a table: mysql> Create Table text (**, **, **); (text is also the name of your table) for example: mysql> Create Table text (ID int, name varchar (20 ));
5. Add a record to the table: mysql> insert into text (ID, name) values (1, 'night ');
6. view the information in the table: mysql> select * from text; (* indicates to view all the information in the table. To view only one of the information, you can write: Select name from text where id = 1 );
7. delete a database: mysql> drop table mytable;
8. auto-increment table IDs: mysql> Create Table text (ID int auto_increment, primary key (ID), name varchar (10); (if you want to have a maximum id value, it should be written as follows: mysql> Create Table text (ID int (20) not null auto_increment, primary key (ID), name varchar (10 ));)
9. Change the table information: mysql> Update mytable Set ID = 6 where name = 'dark ';
10. In the sorting of MySQL rows: Select * from table name order by name (you can specify the order in which to view it );
11. MySQL sorting in columns: alter table table name Modify Field Name field name type after field example: alter table user_info modify user_name varchar (10) after user_id;
12. How to directly access MySQL from the command line: Enter Net start mysqlmysql-u root-P in the command line