解決Access denied for user ''@'localhost' to database 'mysql'問題,deniedlocalhost

來源:互聯網
上載者:User

解決Access denied for user ''@'localhost' to database 'mysql'問題,deniedlocalhost

在修改mysql的root使用者密碼後,再登陸,提示如標題的錯誤,找了一番答案之後,終於解決,步驟如下:

1.停掉mysql:      service mysqld stop

2.使用不驗證的狀態登陸mysql:   

          mysqld_safe --skip-grant-tables &   //後台運行

          啟動mysql:   service mysqld start

3.進入mysql:    mysql -u root

4.use mysql;

5.delete from user where user='';   刪除空使用者

6.flush previlige;    重新整理許可權

7.service mysqld restart

8.問題解決



串連JAVA串連MySQL出錯: Access denied for user ''@'localhost' to database 'qquser'

很明顯,沒有許可權
 
ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql

你看下 庫名為mysql 資料庫中的user 表

看一下 root 使用者的 create_priv 許可權是否被設定為N了?

也不知道是不是串連使用者地過多造成的?
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.