mysql ERROR 1045 (28000): Access denied for user解決方法
問題重現(以下討論範圍僅限Windows環境):
C:\AppServ\MySQL> mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using
password: YES)
編輯mysql配置檔案my.ini(不知道在哪請搜尋),在[mysqld]這個條目下加入
skip-grant-tables
儲存退出後重啟mysql
1.點選“開始”->“執行”(快捷鍵Win+R)。
2.啟動:輸入 net stop mysql
3.停止:輸入 net start mysql
這時候在cmd裡面輸入mysql -u root -p就可以不用密碼登入了,出現password:的時候直接回車可以進入,不會出現ERROR 1045 (28000),但很多操作都會受限制,因為我們不能grant(沒有許可權)。按下面的流程走(紅色部分為輸入部分,粉紅色的是執行後顯示的程式碼不用輸入):
1.進入mysql資料庫:
mysql> use mysql;
Database changed
2.給root使用者設定新密碼,藍色部分自己輸入:
mysql> update user set password=password("新密碼") where user="root";
Query OK, 1 rows affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0
3.重新整理資料庫
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
4.退出mysql:
mysql> quit
Bye
改好之後,再修改一下my.ini這個檔案,把我們剛才加入的"skip-grant-tables"這行刪除,儲存退出再重啟mysql就可以了。
相關文章
- 解決Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'MySqlErrorlocalhost
- ERROR 1045 (28000): Access denied for userError
- Mysql:ERROR 1045 (28000): Access denied for user 'root'@'localhost'MySqlErrorlocalhost
- 解決Mysql:ERROR 1045 (28000):Access denied for user ‘root‘@‘localhost‘ (using password: NO)的方法MySqlErrorlocalhost
- 登入mysql報ERROR 1045 (28000): Access denied 解決方法MySqlError
- ERROR 1045 (28000): Access denied for user 'root'@'localhost'Errorlocalhost
- Error 1045(28000) Access Denied for user 'root'@'localhost'Errorlocalhost
- rhel4 mysql5.1登陸ERROR 1045 (28000): Access denied for userMySqlError
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password:YES)Errorlocalhost
- MySQL 登入資料庫報錯'ERROR 1045 (28000): Access denied for user'..'@'localhost''MySql資料庫Errorlocalhost
- 報錯”ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)”Errorlocalhost
- ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)Error127.0.0.1
- MySQL 8.0.13 密碼問題 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)MySql密碼Errorlocalhost
- linux安裝MySQL出現ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)LinuxMySqlErrorlocalhost
- Mysql 5.5 原始碼安裝後建立使用者報錯"ERROR 1045 (28000): Access denied for user"MySql原始碼Error
- Linux錯誤 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)LinuxErrorlocalhost
- MYSQL解決error: 'Access denied for user 'root'@'localhost' (using password:MySqlErrorlocalhost
- ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)Errorlocalhost
- 解決mysql“Access denied for user 'root'@'localhost'”MySqllocalhost
- mysql 1045, "Access denied for user 'root'@'localhost' (using password: NO)"MySqllocalhost
- Ubuntu18.04:mysql:ERROR 1698 (28000): Access denied for user ‘root‘@‘localhost‘UbuntuMySqlErrorlocalhost
- mysql登入報錯提示:ERROR 1045 (28000)的解決方法MySqlError
- 【MySQL】---1045-Access denied for user 'root'@'localhost'(using password :YES)MySqllocalhost
- #1045 - Access denied for user 'root'@'localhost' (using password: NO)localhost
- MySQL使用普通使用者訪問返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'MySqlErrorlocalhost
- Mysql 5.7 CentOS Access denied for user 'root'@'localhost'解決方式MySqlCentOSlocalhost
- 解決mysql"Access denied fot user 'root'@'localhost'"問題MySqllocalhost
- 使用Mysql登入時,ERREORE 1045(28000) 解決方法MySql
- ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'ErrorlocalhostDatabaseMySql
- Access denied for user ‘root‘@‘localhost‘問題的解決localhost
- 關於mysql登入出現報錯資訊:ERROR1045(28000)的解決方法MySqlError
- ubuntu mysql Access denied for user root@localhostUbuntuMySqllocalhost
- ERROR 1045 (28000): ProxySQL Error: 報錯ErrorSQL
- mysql登入遇到ERROR 1045問題解決方法MySqlError
- mac os x 安裝mysql遇到 Access denied for user ‘root‘@‘localhost‘ (using password: YES)的解決方法MacMySqllocalhost
- vue專案中連線MySQL時,報錯ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost' (using password:YES)VueMySqlErrorlocalhost
- ERROR 1044 (42000): Access denied for user 'root'@'%' to databaseErrorDatabase
- SQLSTATE[HY000] [1045] Access denied for user ‘root‘@‘localhost‘ (using password: YES)”錯誤的隱藏解決辦法SQLlocalhost