MySQL learning database backup detailed explanation

MySQL learning database backup detailed explanation

1.DB,DBMS,SQL

1.DB (Database): A warehouse that stores and manages data and saves a series of organized data
2.DBMS (Database Management System): Database is a container created and operated by DBMS
3. SQL (Structured Query Language): A language specifically used to communicate with a database. To give an example, DB is a warehouse, DBMS is the staff who operates the warehouse, and SQL is the instructions issued by the boss to the staff. The boss issues instructions to order the staff to operate in the warehouse.

2. Characteristics of the database

1. Persistent storage data
2. Convenient storage and management of data
3. Use a unified method to operate the database

3. SQL Classification

1. DDL : Data Definition Language
2. DML : Data Manipulation Language
3. DQL : Data Query Language
4. DCL : Data Control Language
5. DTL : Data Transaction Language

4. Two ways to start and shut down mysql

1. Start MySQL by finding it in the service interface in Computer Management
2. Open cmd as an administrator and enter net start + the name of the database in the computer (when closing, just change start to stop)

5.MySQL login method ()

1.MySQL comes with a client (use exit to exit)
2. Open cmd as an administrator and enter mysql + -h + host name (localhost is the local machine) + -P (uppercase) + port name (3306) + -u + user name (root) + -p + password (you can also press Enter without a password)
3. Open cmd as an administrator, enter mysql -uroot -p, press Enter, and enter the password

6. SQL Language Specification

1. Commands are not case sensitive
2. It is best to end with a semicolon
3. Long commands can be entered in line breaks
4. Notes:
Single-line comment: #+comment content –+space+comment content Multi-line comment: /* +*/
5. Bullet mark + field + bullet mark: convenient for identifying fields

7. Navicat commonly used shortcut keys

1. ctrl+q : open the query window
2. ctrl+/ : Comment
3. ctrl+r : Run the SQL statement in the query window
4. F6 : Open a MySQL command line window
5. ctrl+n : Open a new query window

8. Database backup and restore

Backup statement:

mysqldump + -uroot -p + database name to be backed up + > + path

Now we can look at our database and open the student table in the student database:

insert image description here

Let's first back up the student database to the a.sql file in drive D:

insert image description here

Note: Since mysqldump is a file in the bin directory, you need to go to your MySQL bin directory first if you want to use it.

Then your D drive will have a.sql file:

insert image description here

Then we delete and restore the student database:

insert image description here

Note: If we want to restore after deletion, we need to create a new student database, and then import the contents of the file into the database. When we import, please note that we must first enter this database

insert image description here

Import the file into the database: source + file location

insert image description here

When I checked again, the file had been imported successfully.

The above is the detailed content of the detailed explanation of database backup in MySQL learning. For more information about MySQL database backup, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Detailed explanation of real-time backup knowledge points of MySQL database
  • Detailed explanation of three ways to backup mysql
  • Several ways to backup MySql database
  • Summary of various implementation methods of mysql database backup
  • MySQL database introduction: detailed explanation of database backup operation

<<:  How to configure the Runner container in Docker

>>:  Essential Handbook for Web Design 216 Web Safe Colors

Recommend

12 types of component communications in Vue2

Table of contents 1. props 2..sync 3.v-model 4.re...

Detailed explanation of MySQL database Event scheduled execution tasks

1. Background As the project's business conti...

How to use default values ​​for variables in SASS

Variables defined in SASS, the value set later wi...

Summary of Common Problems with Mysql Indexes

Q1: What indexes does the database have? What are...

MySQL chooses the right storage engine

When it comes to databases, one of the most frequ...

Mysql anonymous login cannot create a database problem solution

Frequently asked questions Access denied for user...

MySQL 5.7.17 installation and configuration tutorial under CentOS6.9

CentOS6.9 installs Mysql5.7 for your reference, t...

Teach you how to build a Hadoop 3.x pseudo cluster on Tencent Cloud

1. Environmental Preparation CentOS Linux release...

JavaScript implements asynchronous acquisition of form data

This article example shares the specific code for...

jQuery implements a simple carousel effect

Hello everyone, today I will share with you the i...

Common rule priority issues of Nginx location

Table of contents 1. Location / Matching 2. Locat...

One line of CSS code to achieve the integration of avatar and national flag

It’s National Day, and everyone is eager to celeb...