Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the import and export commands in mysql

Shulou Source: shulou.com Published: 2022-05-31 22:31:36 10月01日 Update

This article shows you what import and export commands are available in mysql, which are concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

1. Export the entire database

Mysqldump-u user name-p database name > exported file name

Mysqldump-u aaron-p test > aaron.sql

two。 Export a table

Mysqldump-u user name-p database name table name > exported file name

Mysqldump-u aaron-p test > aaron_users.sql

3. Export a database structure

Mysqldump-u aaron-p-d-- add-drop-table aaron > d:aaron_db.sql

-d No data-- add-drop-table adds a drop table before each create statement

4. Import database

Common source commands

Go to the mysql database console

Such as mysql-u root-p

Mysql > use database

Then use the source command, followed by a script file (such as .sql used here)

Mysql > source d:wcnc_db.sql

The above are the import and export commands in mysql. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Data database commands files content skills file names users user names knowledge concise concise parameters that is commonly used console articles more articles structure Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Tech Info Shulou Information Shulou Technology Microsoft