1: Use the show statement to find out what database currently exists on the server:
mysql> SHOW DATABASES;
2:2. Create a database Mysqldata
mysql> CREATE DATABASE mysqldata;
3: Select the database you created
mysql> use Mysqldata; (press ENTER to appear database changed the operation is successful!) )
4: See what tables exist in the current database
mysql> SHOW TABLES;
5: Create a database table
mysql> CREATE TABLE MYTABLE (name VARCHAR), sex CHAR (1));
6: Show the structure of the table:
mysql> DESCRIBE MYTABLE;
7: Add a record to the table
mysql> INSERT INTO MYTABLE values ("HyQ", "M");
8: Loading data into a database table in text mode (for example, D:/mysql.txt)
mysql> LOAD DATA LOCAL INFILE "D:/mysql.txt" into TABLE MYTABLE;
9: Import. sql File command (for example, D:/mysql.sql)
mysql>use database;
Mysql>source D:/mysql.sql;
10: Delete Table
mysql>drop TABLE MYTABLE;
11: Clear the table
mysql>delete from MYTABLE;
12: Update data in table
mysql>update MYTABLE Set sex= "F" where name= ' HyQ ';