最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
當(dāng)前位置: 首頁 - 科技 - 知識(shí)百科 - 正文

mysqlAccessdeniedforuser‘root’@’localhost’(usingpassword:YES)解決方法

來源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-09 20:57:20
文檔

mysqlAccessdeniedforuser‘root’@’localhost’(usingpassword:YES)解決方法

mysqlAccessdeniedforuserroot@localhost(usingpassword:YES)解決方法:今天在啟動(dòng)mysql時(shí)出現(xiàn)以下問題: [root@www ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 網(wǎng)上的答案是各種各樣的,最終解決問題的
推薦度:
導(dǎo)讀mysqlAccessdeniedforuserroot@localhost(usingpassword:YES)解決方法:今天在啟動(dòng)mysql時(shí)出現(xiàn)以下問題: [root@www ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 網(wǎng)上的答案是各種各樣的,最終解決問題的

今天在啟動(dòng)mysql時(shí)出現(xiàn)以下問題:

[root@www ~]# mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

網(wǎng)上的答案是各種各樣的,最終解決問題的方法總結(jié)為以下,好多都是沒有設(shè)置初始密碼造成此問題的。

解決方法如下:

[root@www ~]# service mysqld stop #先關(guān)閉mysql服務(wù)
Stopping mysqld: [ OK ]
[root@www ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@www ~]# mysql -u root -p #關(guān)閉服務(wù)后又出現(xiàn)如下問題
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@www ~]# mysql -u root mysql #鍵入此命令進(jìn)入mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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> update user set password=password('123') where user='root' and host='localhost'; ---->修改root的密碼
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush priviledge;
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 'priviledge' at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> \q
Bye
[root@www ~]# mysql -u root -p ------>重新進(jìn)入
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
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> \q
Bye

到此就完了??!

您可能感興趣的文章:

  • MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)問題的解決
  • mysql ERROR 1044 (42000): Access denied for user ''''@''localhost'' to database
  • linux mysql忘記密碼的多種解決或Access denied for user ''root''@''localhost''
  • 解決mysql創(chuàng)建數(shù)據(jù)庫后出現(xiàn):Access denied for user ''root''@''%'' to database ''xxx''的問題
  • 解決ubuntu 16.04安裝mysql5.7.17后,登錄時(shí)出現(xiàn)ERROR 1045 (28000): Access denied for user ''root''@''localhost''問題
  • MySQL ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using password: NO) 的原因分解決辦法
  • ubuntu系統(tǒng)中Mysql ERROR 1045 (28000): Access denied for user root@ localhost問題的解決方法
  • 新裝MySql后登錄出現(xiàn)root帳號(hào)提示mysql ERROR 1045 (28000): Access denied for use的解決辦法
  • Linux連接mysql報(bào)錯(cuò):Access denied for user ‘root’@‘localhost’(using password: YES)的解決方法
  • 聲明:本網(wǎng)頁內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

    文檔

    mysqlAccessdeniedforuser‘root’@’localhost’(usingpassword:YES)解決方法

    mysqlAccessdeniedforuserroot@localhost(usingpassword:YES)解決方法:今天在啟動(dòng)mysql時(shí)出現(xiàn)以下問題: [root@www ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 網(wǎng)上的答案是各種各樣的,最終解決問題的
    推薦度:
    標(biāo)簽: 解決辦法 root 解決
    • 熱門焦點(diǎn)

    最新推薦

    猜你喜歡

    熱門推薦

    專題
    Top