My experience in using common SQL statements for mysql table creation
Mysql common SQL statements for table creation
Connection: mysql-h host address-u user name-p user password (note: u and root do not need to add spaces, the same is true for others)
Disconnected: exit (press enter)
Create authorization: grant select on database. * to username @ login host identified by/"password /"
Change password: mysqladmin-u username-p old password new password
Delete authorization: revoke select, insert, update, delete om *. * from test2 @ localhost;
Display database: show databases;
Show table: show tables;
Display table structure: describe table name;
Database creation: create database name;
Delete database: drop database name;
Use Database (selected database): use database name;
Create table: create table name (field setting list );
Delete table: drop table name;
Alter table t1 rename t2
Query table: select * from table name;
Clear table: delete from table name;
Backup table: mysqlbinmysqldump-h (ip)-uroot-p (password) databasename tablename> tablename. SQL
Restore table: mysqlbinmysql-h (ip)-uroot-p (password) databasename tablename <tablename. SQL (delete the original table before the operation)
ADD column: alter table t2 ADD c int unsigned not null AUTO_INCREMENT, add index (c );
ALTER column: alter table t2 MODIFY a tinyint not null, CHANGE B c CHAR (20 );
Delete COLUMN: alter table t2 drop column c;
Backup database: mysql/bin/mysqldump-h (ip)-uroot-p (password) databasename> database. SQL
Recover database: mysql/bin/mysql-h (ip)-uroot-p (password) databasename <database. SQL
Copy database: mysql/bin/mysqldump -- all-databases> all-databases. SQL
Fix the database: mysqlcheck-A-o-uroot-p54safer
Text data import: load data local infile/"file name/" into table name;
Data import and export: mysql/bin/mysqlimport database tables.txtbitsCN.com
The above is my personal experience sharing _ mysql content for commonly used SQL statements for MySQL table creation. For more information, see PHP Chinese network (www.php1.cn )!