MySQL grant用户授权 和 MYSQL bin-log日志 实操讲解
这一次我来简单地实际操作讲解下grant用户授权和bin-log日志,博文中配了很多操作过程中的图作为步骤流程讲解,大家跟着过程自己在电脑操作一遍,基本上就懂这方面的相关知识了。不多说,直接进入知识讲解。
远程主机连接用户授权 例:192.168.1.111mysql服务器 和192.168.1.112mysql服务器
一、MySQL grant用户授权
192.168.1.111登陆mysql ,给用户授权
查询下是否添加此用户
这样就成功给IP为192.168.1.112的主机授权mysql登陆账号为user2 密码为123456的 管理用户;
此时我们在192.168.1.112进行连接

此时会报一个错误:说无法连接192.168.1.111mysql服务器
原因是:192.168.1.111的防火墙开启了,此时只需要关闭防火墙即可

然后再到192.168.1.112mysql服务器进行连接

授权成功!
二、MYSQL bin-log日志
MYSQL bin-log日志主要用于数据备份和恢复;其文件中保存了数据库的所有增删改操作
1、开启bin-log日志:


2、查看bin-log日志
连接成功数据库后
可以查看log_bin是否开启成功
查看bin-log日志

3、与bin_log有关的日志刷新
此时就会多一个最新的bin_log日志
可以再/usr/local/mysql/var中看到多了个mysql-bin.xxxxxx
查看最后一个bin-log日志

清空所有bin-log日志

大家只要按着步骤自己去操作一遍,基本上都能成功,若遇到问题,可以留言,本人会抽出时间予以解答。
下次的博文将重点讲解 数据备份和恢复,以及主从复制技术。欢迎关注。
如果此博文中有哪里讲得让人难以理解,欢迎留言交流,若有讲解错的地方欢迎指出。
如果您觉得您能在此博文学到了新知识, 请为我顶一个 ,如文章中有解释错的地方,欢迎指出。
互相学习,共同进步!