MySQL command line is to learn the MySQL database must have knowledge, the following for you to introduce 10 useful MySQL command line, I hope you learn the MySQL command line can help.
1, display the structure of the data table:
mysql> DESCRIBE table name; (DESC table name)
2, the establishment of data tables:
mysql> use library name; Access to the database
mysql> CREATE table name (field name VARCHAR (20), Field name CHAR (1));
3, delete the data table:
mysql> DROP table name;
4. Renaming data tables
ALTER TABLE t1 rename T2;
5, display the records in the table:
Mysql> SELECT * from table name;
6. Insert records into the table:
mysql> INSERT into table name VALUES ("HyQ", "M");
7, update the data in the table:
mysql-> UPDATE table name SET field name 1= ' A ', field name 2= ' B ' WHERE field name 3= ' C ';
8. Empty the record of the table:
Mysql> DELETE from table name;
9. Loading data into the data table by means of text:
mysql> LOAD DATA Local INFILE "d:/mysql.txt" to table name;
10, show the definition of the table, you can also see the table constraints, such as foreign keys
These are the 10 most common MySQL command lines introduced.