MySQL Common client commands

Source: Internet
Author: User

1 log in to MySQL2Mysql-h Localhost-uroot-P3 4 authorizing the specified user to access the specified database5GRANT all on cookbook.* to'Cbuser'@'localhost'Identified by'Cbpass';6 7 Create a database8 CREATE DATABASE Cookbook;9 Ten Working with Databases One Use Cookbook A  - exporting tables and their data in a database -Mysqldump-h localhost-p-u cbuser Cookbook >Cookbook.sql the The entire database is backed up as SQL and can be done when the amount of data is small -  - execute an external SQL script -SOURCE ~/Cookbook.sql + executing the source command requires that you have logged in to the database -  +Mysql-uroot-p-D Cookbook <Cookbook.sql A this way, you can execute an external script without logging in to the database at  - saves the executed SQL to the specified file -MySQL--Tee=tmp.out Cookbok -You do not need to enter a user name and password because you have specified a login username and password

MySQL Common client commands

Related Article

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.