Linux-6.5下基于MySQL命令行模式备份数据方法详解_MySQL
理解部分:
逻辑备份:只备份表中的某一些符合调价的数据,而非全部数据。但是很独特的地方在于导出来的是文本信息,那么很显然比mysqldump节约空间的,这是毋庸置疑的;但是库表它本身没有办法创建。我们也难以保证是精确的;
所以还是mysqldump好用的。只有备份表总的部分行的时候才会使用它进行,甚至于备份部分行、部分字段的时候会用到。格式: SELECT clause INTO OUTFILE '' LOAD DATA INFILE '' INTO TABLE tb_name
1、连入MySQL:

2、查看students表中的所有Gender是 M 导出:

3、执行此命令将其导入/tmp:

4、查看/tmp下的stu.txt文本信息:

5、创建一个与students表一样结构的表:

6、查看表结构:

7、注意这时候是没有插入数据的:

8、导入/tmp/下的stu.txt 文本:

9、查看表中的数据是否被导入:

10、还有其它的备份工具请出门左转查看:mysqldump、innobackupex、LVM快照的配置解析:

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)
