1: using 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 that 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: To Create a database table
Mysql> CREATE TABLE MYTABLE (name VARCHAR), Sexchar (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: load data into a database table in text mode (for example, D:/mysql.txt )
mysql> LOAD DATA LOCAL INFILE "D:/mysql.txt" intotable MYTABLE;
9: Import. SQL file commands (e.g. D:/mysql.sql)
Mysql>use database;
Mysql>source D:/mysql.sql;
Ten: Delete a table
Mysql>drop TABLE MYTABLE;
One : Clear Table
Mysql>delete from MYTABLE;
: updating data in a table
Mysql>update MYTABLE set sex= "F" where name= ' HyQ ';
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Sql--mysql Query Statement Daquan