MySQL导入数据权限问题如何解决

网友投稿 733 2023-07-07

MySQL导入数据权限问题如何解决

MySQL导入数据权限问题如何解决

环境:鼓捣玩的时候部署了新版zabbix的时候需要将zabbix包里的三个sql数据导入到新的mysql中,mysql版本为8.0

报错日志:

#警告:在工作台上展示密码不安全----->这个无关紧要mysql: [Warning] Using a password on the command line interface can be insecure.#RROR 1044(42000):用户“zabbix”@“localhost”对数据库“zabbix”的访问被拒绝ERROR 1044 (42000): Access denied for user 'zabbix'@'localhost' to database 'zabbix'

排查思路

1.进入数据库中查看:

[root@zabbix6 ~]# mysql -uroot -p11111mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 57Server version: 8.0.30 MySQL Community Server - GPLCopyright (c) 2000, 2022, *** and/or its affiliates.*** is a registered trademark of *** Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || performance_schema |+--------------------+2 rows in set (0.03 sec)#可以看到里面没有我们所需要的zabbix库,接下来创建zabbix库mysql> create databases zabbix;ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases zabbix' at line #无法创建,接下来就是考虑是否是因为权限问题登录后复制

2.查看mysq配置文件安全设置:

[root@zabbix6 ~]# vim /etc/my.cnf37:skip-grant-tables#跳过表的权限验证,用户可以执行增删改查登录后复制

3.重启mysql服务

[root@zabbix6 ~]# systemctl restart mysql登录后复制

4.导入数据

剩下的我们我就可以将zabbix的3个sql数据导入到mysql中

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:java怎么通过MySQL驱动拦截器实现执行sql耗时计算
下一篇:MySQL中怎么实现join buffe
相关文章