MySQL導(dǎo)入數(shù)據(jù)權(quán)限問題的解決
環(huán)境:鼓搗玩的時(shí)候部署了新版zabbix的時(shí)候需要將zabbix包里的三個(gè)sql數(shù)據(jù)導(dǎo)入到新的mysql中,mysql版本為8.0
報(bào)錯(cuò)日志:
#警告:在工作臺(tái)上展示密碼不安全----->這個(gè)無關(guān)緊要
mysql: [Warning] Using a password on the command line interface can be insecure.
#RROR 1044(42000):用戶“zabbix”@“localhost”對(duì)數(shù)據(jù)庫“zabbix”的訪問被拒絕
ERROR 1044 (42000): Access denied for user 'zabbix'@'localhost' to database 'zabbix'
排查思路
1.進(jìn)入數(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)建,接下來就是考慮是否是因?yàn)闄?quán)限問題
2.查看mysq配置文件安全設(shè)置:
[root@zabbix6 ~]# vim /etc/my.cnf 37:skip-grant-tables #跳過表的權(quán)限驗(yàn)證,用戶可以執(zhí)行增刪改查
3.重啟mysql服務(wù)
[root@zabbix6 ~]# systemctl restart mysql
4.導(dǎo)入數(shù)據(jù)
剩下的我們我就可以將zabbix的3個(gè)sql數(shù)據(jù)導(dǎo)入到mysql中
到此這篇關(guān)于MySQL導(dǎo)入數(shù)據(jù)權(quán)限問題的解決的文章就介紹到這了,更多相關(guān)MySQL導(dǎo)入數(shù)據(jù)權(quán)限問題內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
利用Shell腳本實(shí)現(xiàn)遠(yuǎn)程MySQL自動(dòng)查詢
本篇文章是對(duì)利用Shell腳本實(shí)現(xiàn)遠(yuǎn)程MySQL自動(dòng)查詢的方法進(jìn)行了詳細(xì)的分析介紹,需要的朋友參考下2013-06-06
MySQL給查詢記錄增加序列號(hào)的實(shí)現(xiàn)方法
這篇文章主要介紹了MySQL給查詢記錄增加序列號(hào)的實(shí)現(xiàn)方法,文中通過代碼示例講解的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作有一定的參考價(jià)值,需要的朋友可以參考下2023-11-11
mysql輸入中文出現(xiàn)ERROR 1366的解決方法
這篇文章主要為大家詳細(xì)介紹了mysql輸入中文出現(xiàn)ERROR 1366的解決方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-04-04

