MySQL Database common commands

Source: Internet
Author: User

Login:

Mysql-h server address-u login name-P Port-p password

(It is best to login without entering the password, wait for the next prompt to come out and then lose, so you can hide the password in the interface)

Exit:

Quit or exit

Note: After logging into the database system, you need to use "Set names encoded name;" To set the "environment variable" that is currently connected to the database, which is the encoding of the "client" itself that is currently dealing with the database. Generally speaking:

~cmd is fixed in the client using GBK encoding;

~ and PHP page, is the encoding of the page file (now mainstream is utf-8)

Backup:

Mysqldump-h server address-u login name-P port-p to back up the database name > file to be saved as

(such as: Mysql-hlocalhost-uroot-p db1 > C:/database/1.sql)

Recovery:

Recovering data from backup to another database

(such as: Mysql-hlocalhost-uroot-p DB2 < C:/database/1.sql)

MySQL Database common commands

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.