Mysqlcmd common command bitscn.comput mysql.exe in the bindirectory of mysqldirectory under C:/WINDOWS, you can execute the following command
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;
Database used: 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;
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.