In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following is mainly about how to restore the backup of mysqldump. I hope these words can bring you practical use. This is also the main purpose of this article that I edit mysqldump how to restore backup. All right, don't talk too much nonsense, let's just read the following.
Mysqldump backup description:
# mysqldump-uroot-p123456 test > test.sql # mysqldump-uroot-p123456-B test > test.sql # difference:-B the database name to be created will also be backed up # mysqldump-uroot-p123456-B test | gzip > test.sql.gz backup library and compressed
The backup principle of mysqldump:
In fact, it is the process of directly exporting data from the mysql library in the form of logical sql statements or generating backup files. Belongs to a logical backup.
Physical backup: package the files directly.
# mysqldump-uroot-p123456-B test xpg | gzip > test.sql.gz # backup multiple libraries at the same time
What is the meaning of sub-database backup?
If there is a problem with the data of a library, just import the data of the library, the significance of the sub-database.
Back up a single table:
# mysqldump-uroot-p123456 dbname tablename > test.sql # backup a table in a library # mysqldump-uroot-p123456 dbname tablename1 tablename2 > test.sql # backup multiple tables in a library # mysqldump-uroot-p123456-d dbname tablename > test.sql # just back up the structure of one table, not backup data # mysqldump-uroot-p123456-t dbname tablename > test.sql # just back up the data of a table
Back up all the data in the database:-A
# mysqldump-uroot-p123456-A-B-- events | gzip > test.sql.gz
-- master-data=1 marks the location of the current binlog log record, and the recovery data starts after the master_log_pos of this log.
# mysqldump-uroot-p123456-- master-data=1 test > test.sql
Innodb: storage engine (--single-transaction: locking table)
# mysqldump-uroot-p ""-A-B-- master-data=1-- single-transaction | gzip > / opt/all.sql.gz
08-using source to recover mysql data explanation and actual combat
Source needs to log in to the database.
Mysql > drop database dbname; deletes a library.
Mysql > system ls / opt # check what files are under opt
Mysql > source / opt/...sql
Practice on how to restore mysql after 09 Sub-Database backup
You didn't use-B when you backed up. Restore must specify the library
# mysql-uroot-pendant 123456' dbname
< /opt/mysql_bak.sql 如果是压缩的备份文件。 可以先使用gzip -d 压缩文件。然后在导入。 10-mysql进程-状态-在线修改参数重要指示讲解 -e:交互显示 设置全局变量使用set global key_buffer_size=..,重启后失效 小结:生产常用命令 show global status:查看整个数据库运行状态信息,很重要分析并要做好监控 show full processlist:查看正在执行的完整的sql语句 set global key_buffer_size=32777218 不重启数据库调整数据库参数,直接生效,重启后失败 show variables:查看数据库的参数信息 11-mysqlbinlog命令介绍及实战讲解 mysqlbinlog--》解析mysql的binlog日志 binglog日志是什么? 在data下面。mysql-bin.index是binlog日志文件的索引 作用是:从来记录mysql内部增删改查等对mysql数据库有更新的记录。select不会记录。 binglog会记录所有库所有表的操作日志。不能分开记录相关库的binlog日志 通常情况所有的库日志都在一个binlog里面。 所以要进行拆库:这样将一个的库日志导入到新的文件里面 #mysqlbinlog -d test mysql-bin.000001 >Test.sql # imports binlog logs from the test library into test.sql
For the above about how to restore the backup of mysqldump, do you think it is very helpful? If you need to know more, please continue to follow our industry information. I'm sure you'll like it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.