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

Batch replace part of the data of a field in Mysql (recommended)

Batch replace part of the data of a field in MYSQ...

Issues with upgrading Python and installing Mongodb drivers under Centos

Check the Python version python -V If it is below...

A few things about favicon.ico (it’s best to put it in the root directory)

Open any web page: for example, http://www.baidu....

mysql8.0.23 msi installation super detailed tutorial

1. Download and install MySql Download MySql data...

Use of MySQL DATE_FORMAT function

Suppose Taobao encourages people to shop during D...

Use JS to operate files (FileReader reads --node's fs)

Table of contents JS reads file FileReader docume...

Steps to use autoconf to generate Makefile and compile the project

Preface Under Linux, compilation and linking requ...

mysql uses stored procedures to implement tree node acquisition method

As shown in the figure: Table Data For such a tre...

Functions in TypeScript

Table of contents 1. Function definition 1.1 Func...

Five solutions to cross-browser problems (summary)

Brief review: Browser compatibility issues are of...

Example code for implementing dynamic column filtering in vue+element table

Requirement: When displaying data in a list, ther...

Five ways to traverse objects in javascript Example code

Table of contents Prepare Five weapons for…in Obj...

10 excellent Web UI libraries/frameworks

1. IT Mill Toolkit IT Mill Toolkit is an open sou...

HTML Basics: The basic structure of HTML

The basic structure of HTML hypertext documents is...