温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2023-03-29 11:25:58 来源:亿速云 阅读:102 作者:iii 栏目:开发技术

这篇文章主要讲解了“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 -p11111
mysql: [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 57
Server version: 8.0.30 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

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.cnf
37:skip-grant-tables
#跳过表的权限验证,用户可以执行增删改查

3.重启mysql服务

[root@zabbix6 ~]# systemctl restart mysql

4.导入数据

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

感谢各位的阅读,以上就是“MySQL导入数据权限问题如何解决”的内容了,经过本文的学习后,相信大家对MySQL导入数据权限问题如何解决这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI