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

How to update, package, and upload Docker containers to Alibaba Cloud

This time, we will try to package the running con...

How to start tomcat using jsvc (run as a normal user)

Introduction to jsvc In production, Tomcat should...

Summary of coalesce() usage tips in MySQL

Preface Recently, I accidentally discovered MySQL...

3 Tips You Must Know When Learning JavaScript

Table of contents 1. The magical extension operat...

Simple setup of VMware ESXi6.7 (with pictures and text)

1. Introduction to VMware vSphere VMware vSphere ...

Use of Linux relative and absolute paths

01. Overview Absolute paths and relative paths ar...

MySQL join buffer principle

Table of contents 1. MySQL join buffer 2. JoinBuf...

Basic usage of UNION and UNION ALL in MySQL

In the database, both UNION and UNION ALL keyword...

Simple implementation method of vue3 source code analysis

Table of contents Preface 🍹Preparation 🍲vue3 usag...

MySQL database development specifications [recommended]

Recently, we have been capturing SQL online for o...

Detailed explanation of the data responsiveness principle of Vue

This article is mainly for those who do not under...

Tutorial on how to quickly deploy a Nebula Graph cluster using Docker swarm

1. Introduction This article describes how to use...

Using CSS3 to achieve progress bar effect and dynamically add percentage

During the project, I started using the js reques...

CentOS 6 uses Docker to deploy Zookeeper operation example

This article describes how to use docker to deplo...