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