Environment: When you deploy a new version of zabbix while tinkering, you need to import the three sql data in the zabbix package into the new mysql. The mysql version is 8.0
#Warning: Displaying passwords on the workbench is insecure----->This is irrelevant
mysql: [Warning] Using a password on the command line interface can be insecure.
#RROR 1044 (42000): Access denied for user 'zabbix'@'localhost' to database 'zabbix'
ERROR 1044 (42000): Access denied for user 'zabbix'@'localhost' to database 'zabbix'
1. Enter the database to view:
[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. View the mysq configuration file security settings:
[root@zabbix6 ~]# vim /etc/my.cnf 37:skip-grant-tables #跳过表的权限验证,用户可以执行增删改查
3. Restart the mysql service
[root@zabbix6 ~]# systemctl restart mysql
4. Import data
The rest of us can import the three sql data of zabbix into mysql
The above is the detailed content of How to solve the problem of MySQL import data permissions. For more information, please follow other related articles on the PHP Chinese website!