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 1
#无法创建,接下来就是考虑是否是因为权限问题
2.查看mysq配置文件安全设置:
[root@zabbix6 ~]# vim /etc/my.cnf
37:skip-grant-tables
#跳过表的权限验证,用户可以执行增删改查
3.重启mysql服务
[root@zabbix6 ~]# systemctl restart mysql
4.导入数据

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值