溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MySQL導入數(shù)據(jù)權(quán)限問題如何解決

發(fā)布時間:2023-03-29 11:25:58 來源:億速云 閱讀:111 作者:iii 欄目:開發(fā)技術(shù)

這篇文章主要講解了“MySQL導入數(shù)據(jù)權(quán)限問題如何解決”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“MySQL導入數(shù)據(jù)權(quán)限問題如何解決”吧!

環(huán)境:鼓搗玩的時候部署了新版zabbix的時候需要將zabbix包里的三個sql數(shù)據(jù)導入到新的mysql中,mysql版本為8.0

報錯日志:

#警告:在工作臺上展示密碼不安全----->這個無關(guān)緊要
mysql: [Warning] Using a password on the command line interface can be insecure.
#RROR 1044(42000):用戶“zabbix”@“l(fā)ocalhost”對數(shù)據(jù)庫“zabbix”的訪問被拒絕
ERROR 1044 (42000): Access denied for user 'zabbix'@'localhost' to database 'zabbix'

排查思路

1.進入數(shù)據(jù)庫中查看:

[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庫,接下來創(chuàng)建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 

#無法創(chuàng)建,接下來就是考慮是否是因為權(quán)限問題

2.查看mysq配置文件安全設(shè)置:

[root@zabbix6 ~]# vim /etc/my.cnf
37:skip-grant-tables
#跳過表的權(quán)限驗證,用戶可以執(zhí)行增刪改查

3.重啟mysql服務

[root@zabbix6 ~]# systemctl restart mysql

4.導入數(shù)據(jù)

剩下的我們我就可以將zabbix的3個sql數(shù)據(jù)導入到mysql中

感謝各位的閱讀,以上就是“MySQL導入數(shù)據(jù)權(quán)限問題如何解決”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對MySQL導入數(shù)據(jù)權(quán)限問題如何解決這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI