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

WBOY
发布: 2023-05-27 13:01:09
转载
2175人浏览过

环境:鼓捣玩的时候部署了新版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服务

MindShow
MindShow

MindShow官网 | AI生成PPT,快速演示你的想法

MindShow 1492
查看详情 MindShow
[root@zabbix6 ~]# systemctl restart mysql
登录后复制

4.导入数据

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

以上就是MySQL导入数据权限问题如何解决的详细内容,更多请关注php中文网其它相关文章!

相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:亿速云网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号