备注:前面那个Warning没有出现了。
######
创建数据库用户、赋权:
mysql> create user zhuohua@localhost identified with mysql_native_password by 'P@ssw9rd';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on db1.* to zhuohua@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> grant process on *.* to zhuohua@localhost;
Query OK, 0 rows affected (0.00 sec)
注释:输入了这条命令,数据库用户zhuohua@localhost才能进行备份数据库。
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
查看数据库用户zhuohua@localhost的权限:
mysql> show grants for zhuohua@localhost;
+----------------------------------------------------------+
| Grants for zhuohua@localhost |
+----------------------------------------------------------+
| GRANT PROCESS ON *.* TO `zhuohua`@`localhost` |
| GRANT ALL PRIVILEGES ON `db1`.* TO `zhuohua`@`localhost` |
+----------------------------------------------------------+
2 rows in set (0.00 sec)
给数据库用户zhuohua@localhost设置登录信息:
[root@redhat8 ~]# mysql_config_editor set --login-path=zhuohua --host=localhost --user=zhuohua -p
Enter password: #输入数据库用户zhuohua@localhost的密码
再次查看当前主机上的加密文件的登录信息:
mysql_config_editor print --all