Mysql import/export password change command summary (note 3) _ MySQL

Source: Internet
Author: User
Mysql import/export password modification command summary (note 3) bitsCN.com

I.Export data from a database

Note that these statements are executed before the mysql command line is started.

C:/Windows/system32> export command

Instead

Mysql> export command

1. export the entire database (including all table structures and data)

Mysqldump-uroot-p database name> xx. SQL

Enter the password:

Or enter the password directly.

Mysqldump-uroot-p password database name> xx. SQL

2. export the structure of all tables in the database (excluding the table data)

Mysqldump-uroot-p password-d database name> XX. SQL

3. export data from one or more database tables (Structure + content)

Mysqldump-uroot-p password database name table name 1 table name 2 and so on> XX. SQL

4. export the structure of a database table

Mysqldump-uroot-p password-d database name tb1 tb2...> XXX. SQL

Import external SQL files to the database

An import file to a database is generally an SQL file, which contains table information and no database information. even if you export the entire database, there is no database name information, therefore, the SQL file does not contain information about the database name (which is included in the notes). before importing, you must create a database, select the database, and execute the import command in the mysql command line.

Mysql> source SQL file path (D: test. SQL)

Clear all data in the database table at one time

Pilot output

C:/Windows/system32> mysqldump-uroot-p password -- no-data database name> xx. SQL

In fact, it is the same as exporting only the table structure

Then, create a database

Create database name

Import xx. SQL in the SQL command line

Mysql> source xx. SQL

Modify mysql password

C:/Windows/system32> mysqladmin-uroot-p original password new password

BitsCN.com

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.