Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Commands for mysql database backup

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "the command of mysql database backup". In the daily operation, I believe that many people have doubts about the command of mysql database backup. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "mysql database backup command". Next, please follow the editor to study!

MYSQL Import and Export Database Command

1. Enter the bin folder under the MySQL directory: the directory from the cd MySQL to the bin folder

As I typed the command line: cd C:Program FilesMySQLMySQL Server 4.1bin

2. Export database: mysqldump-u user name-p database name > exported file name

As I typed the command line: mysqldump-u root-p news > news.sql (it will let you enter the password to enter MySQL)

(if you export a single table, enter the table name after the database name)

3. You will see that the file news.sql is automatically generated under the bin file.

The command line imports the database:

1. Move the imported .sql file to the bin file, which is more convenient.

2, same as step 1 derived above

3. Enter MySQL:mysql-u user name-p

As I typed the command line: mysql-u root-p (the same will let you enter the password of ySQL)

4. Create the database you want to build in MySQL-Front, and the database is empty. For example, create a new database named news

Target database of (mysql > create database news;)

5, enter: mysql > use target database name

As I typed the command line: mysql > use news

6. Import file: mysql > source imported file name

As I typed the command line: mysql > source news.sql

At this point, the study on the command of mysql database backup is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 205

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report