Connection: Mysql-h host address-u user name-P user Password (note: U and root can be without spaces, others are the same)
Disconnect: Exit (Enter)
Create authorization: Grant SELECT on database. * To User name @ login host identified by \ "Password \"
Modify Password: mysqladmin-u user name-p old password password new password
Delete authorization: Revoke Select,insert,update,delete om *.* from Test2@localhost;
Display database: show databases;
Display datasheet: show tables;
Display table structure: describe table name;
Creating a library: Create database name;
Delete Library: drop database library name;
Use library (check library): The name of the using library;
Creating Table: Create table table name (field set list);
Delete table: drop table table name;
Modify table: ALTER TABLE t1 rename T2
Query table: SELECT * from table name;
Empty table: Delete from table name;
Backup table: Mysqlbinmysqldump-h (IP)-uroot-p (password) databasename tablename > Tablename.sql
Recovery table: Mysqlbinmysql-h (IP)-uroot-p (password) databasename tablename < Tablename.sql (delete the original table before operation)
Add column: ALTER TABLE T2 add c INT UNSIGNED not NULL auto_increment,add INDEX (c);
Modify column: Alter TABLE T2 MODIFY a TINYINT not NULL, changing b C CHAR (20);
Delete column: ALTER TABLE T2 DROP column C;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.