Home >Database >Mysql Tutorial >MySQL database restoration, recovery and import operations

MySQL database restoration, recovery and import operations

黄舟
黄舟Original
2017-08-03 10:28:112174browse

MySQL is a relational database management system developed by the Swedish MySQL AB company and currently belongs to an Oracle company. MySQL is the most popular relational database management system. In terms of WEB applications, MySQL is one of the best RDBMS (Relational Database Management System) application software.

MySQL is a relational database management system. A relational database stores data in different tables instead of placing all data in one large warehouse, which increases speed and flexibility.

The SQL language used by MySQL is the most commonly used standardized language for accessing databases. MySQL software adopts a dual licensing policy, which is divided into community version and commercial version. Due to its small size, fast speed, low total cost of ownership, especially open source, MySQL is generally chosen as the website database for the development of small and medium-sized websites. .

1. Start - Run - enter cmd and confirm

MySQL database restoration, recovery and import operations

2. Enter the Dos command line, enter mysql -uroot -p, press Enter and enter the root password to log in to the mysql command line

Command explanation:

mysql -u 用户名 -p

Note:

If the bin path is configured during installation, you can directly enter the mysql command

If the bin path is not configured during installation, you need to switch to the mysql installation directory Enter the mysql command in the bin directory

MySQL database restoration, recovery and import operations

##3. First create an empty database

 create database backup;

Command explanation:

 create database 数据库名称;

MySQL database restoration, recovery and import operations

4. Select the database to be restored

 use backup;

Command explanation:

use 数据库名称;

MySQL database restoration, recovery and import operations

5. Restore or import the database

source E:\backup.sql

Command explanation

source database script file;

MySQL database restoration, recovery and import operations

#6. After restoring or importing, check the database table to see that the import has been successful.

show tables;

MySQL database restoration, recovery and import operations

7. Exit mysql

quit;

This will exit mysql and enter the Dos command line

Supplement:

Regarding how to use other msyql commands, you can click on the author's business card and find it in the experience list.

MySQL database restoration, recovery and import operations

The above is the detailed content of MySQL database restoration, recovery and import operations. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn