cmd operation in Windows MySQL

Source: Internet
Author: User

It should be noted that the operation should remember the end of the semicolon

If you forget to enter a semicolon you can use \c to end the command input

Common operations are the following table:

1 The Mysql.exe in the bin directory under the MySQL directory is placed under C:\WINDOWS, and you can execute the following command2 3Connection: Mysql-h host Address-u user name-P user password (note: You and root can use no space, the other is the same)4 Disconnect: Exit (Enter)5 6 7Create authorization: Grant SELECT on database. * To User name @ login host identified by \"password \ "8Change Password: mysqladmin-u user name-p old password password new password9Delete authorization: Revoke select,insert,update,delete OM * * from[email protected];Ten  One  A Display database: show databases; - Display Data sheet: show tables; - Display table structure: Describe table name; the  -  - Create library: Name of creation database; - Delete Library: drop database name; + Usage Library: Use library name; -  +  A Creating tables: Create table table names (field settings list); at Delete tables: drop table name; - Modify table: ALTER TABLE t1 rename T2 -Query table: SELECT * fromtable name; -Empty table: Delete fromtable 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) in  -  to 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, change b C CHAR (20);  - Delete column: ALTER TABLE T2 DROP column C; the  *  $Backup database: Mysql\bin\mysqldump-h (IP)-uroot-p (password) databasename > Database.sql

cmd operation in Windows MySQL

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.