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

A simple method for backup and restore of MySql5.5 data

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the simple methods of MySql5.5 data backup and restore, the contents of the articles are carefully selected and edited by the author, with a certain pertinence, the reference significance for everyone is still relatively great, the following with the author to understand the simple methods of MySql5.5 data backup and restore.

-- Export a table in the database mysqldump-uroot-pdbpasswd-d dbname test > db.sql

-- backup the database (only prepare the tables and the contents of the tables in the original database, not including the database itself)

-- DOS command line exports the database:

-1. Click start-> run-> cmd- > cd to enter the directory where mysql's bin is located.

-- 2. Use one of the following commands (- d for output structure)

-- 3. (a) mysqldump-uroot-pdbpasswd-d dbname test > db.sql; (the output file is in the bin directory of mysql)

-- (b) mysqldump-uroot-p account model > D:\\ model.sql; (the output file is under D: disk)

-- (c) mysqldump-uroot-p account > alltable.sql; (the output file is in mysql's bin directory)

If an error is reported: mysqldump: unknown option'--no-beep'

-- then change the code to: mysqldump-- no-defaults-uroot-proot account > alltable.sql

-- Note: it's too much-- no-defaults

-restore the database

-1. Enter the MySQL Command Line Client, enter the password, and enter the mysql > command interface.

-- 2. Enter the command "show databases" to view all existing databases to facilitate the following steps

-3. Create the database you want to restore, for example: enter "create database account;"

-- 4. Switch to the newly created database and type "use account"

-5. Import data, enter "source D:zhangyicun.sql"

-6. When you start the import, "mysql >" appears again and the restore is successful without prompting an error.

-7. View table restore results: enter "show tables" to view the restored table

After reading the above simple methods of MySql5.5 data backup and restore, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

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: 0

*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