当前位置:网站首页>Mysqldump full recovery to another new instance, and then perform flush privileges analysis
Mysqldump full recovery to another new instance, and then perform flush privileges analysis
2022-07-19 09:25:00 【51CTO】
Preparation before experiment
mysql 1: Express mysql Example 1
mysql 2: Table is mysql Example 2
If mysqldump One library is available , A new instance is created 2, example 2 Besides root Users have no other users , however root The passwords are different , that mysql.user Can you recover successfully , perform flush privileges What's going to happen .
mysqldump be completely ready
mysql 1:root password 123456, Perform a full backup
mysql 2:root password 234567
Full recovery
mysql 2: After logging in
source /tmp/all.sql To succeed
mysql 2:mysql.user Tables are also updated
Resume exception analysis
sign out mysql 2, Log in again , Password error found , Use mysql 1 Of root password , Login successful
Analysis conclusion
Use full recovery to restore to a new instance , Because backup mysql.user surface
flush privileges Will overwrite the current database mysql 2 Passwords and permissions , Turn into mysql 1 Password and permissions
flush privileges When was it used , When the permission data in the data table is inconsistent with the permission data in memory ,
Can be used to rebuild memory data , Get to a consistent state .
flush privileges The command will clear acl_users Array , And then from mysql.user Read data from the table and reload ,
Reconstruct a acl_users Array . in other words , The data in the data sheet shall prevail , The global permission memory array will be reloaded .
therefore ,mysql.user The execution of the flush privileges It can be recovered later .
Add
mysql The permissions of are determined by mysql.user Tables and memory arrays acl_users control
mysql The connection between the client and the server will be assigned a thread , By memory acl_users Array control , Check the permissions of this user from the array in memory , And copy the permission value to the thread object . Therefore, the situation shown above will occur , The new instance imports mysql.user surface , But the new instance can still use its original root Password to login , But once flush privileges, The memory array is reloaded , Then the password permission will be overwritten .
边栏推荐
- AnyControl Demo演示
- 【网络研究院】机器学习系统的威胁是时候该认真对待了
- 【C语言】数组知识点总结
- 【洛谷】P2357 守墓人
- Case sharing | build a one-stop data development platform for hehe information based on linkis+dss
- Data Lake (20): Flink is compatible with iceberg, which is currently insufficient, and iceberg is compared with Hudi
- How to synchronize historical data when MySQL is upgraded to primary and standby?
- cookie和session在实际项目中的使用
- Towhee daily model weekly report
- Pytorch框架之优化器 Optimizer
猜你喜欢
随机推荐
SSM implementation of one-to-one query detailed tutorial (1)
Go exceed API source code reading (II) -- openFile ()
Vector容器的系列操作( 详解 )
Towhee daily model weekly report
C语言基础篇 —— 2-1 指针与野指针
[fishing artifact] UI library second low code tool - form part (II) sub control
Target detection model size calculation, model complexity (parameter conversion formula)
将视频格式转换为gif图片格式
R语言ggplot2可视化分面图(faceting):ggplot2可视化分面图并移除分面图之间的边框线、以及分面图之间的间隙(Remove Spacing between Panels)
Anycontrol demo demo demo
DEDECMS织梦保存当前栏目更改时失败的解决方法
【愚公系列】2022年7月 Go教学课程 012-强制类型转换
Simple third-party component log desensitization
代码随想录:刷题记录(更新中)
mysql进阶(六)模糊查询的四种常见用法介绍
【Flink】Flink 设置检查点失败一次就报错 setTolerableCheckpointFailureNumber 不起作用
Two structures ifconf and ifreq
565. Array nesting
KNN分类器
Encapsulation API, request interception, response interception, authentication timeliness









