簡體   English   中英

優勝美地更新后無法登錄MySQL

[英]Can't login to MySQL after Yosemite update

首先,我說我瀏覽了無數有關重置mysql密碼的帖子(無論是在這里還是在Internet上 ),但似乎沒有任何用處。 哦,我在命令行上也很新。

上周,我將osx更新為優勝美地,今天當我嘗試更新Apache設置時,我發現我無法再連接到MySQL。 在更新之前,一切工作正常(MySQL擁有一個我知道並能使用的密碼),所以我不知道發生了什么。 奇怪的是,我也將另一台(較舊的)筆記本電腦也更新為優勝美地,並且在一台MySQL上現在運行良好。

當我打開phpmyadmin時,我無法登錄。 保存的密碼(來自更新之前的密碼,適用於Mavericks)似乎不再起作用。

下面是我在命令行上嘗試過的內容(有無首先啟動/停止MySQL(以安全模式)):


mysql root
#Gives me: ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'root'

mysql -u root
#Gives me: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

mysql -u root -p
#Gives me: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

我可以使用mysql命令,這使我


Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.6.21 MySQL Community Server (GPL)

Copyright (c) 2000, 2014, 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> 

嘗試在此處更新密碼可獲取以下信息


mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user'
mysql> 

我真的希望有人知道可能是什么問題,因為我沒有選擇

我將本文用作更新Apache設置的參考

編輯:塔塔評論后的其他信息

該注釋給我-bash: /etc/init.d/mysqld: No such file or directory

另外sudo mysqld_safe --skip-grant-tables給了我:

141102 18:11:26 mysqld_safe Logging to '/usr/local/mysql/data/Maurices-MacBook-Pro.local.err'.
141102 18:11:26 mysqld_safe A mysqld process already exists

在那之后,我仍然無能為力。

不幸的是,我不知道在哪里可以找到mysql的初始化腳本以及要修改的內容。

我已經通過serverfault找到了解決方案。 我忘記了我已經添加了一個com.mysql.mysql.plist文件,該文件是在啟動時通過launchctl加載的, launchctl在啟動時自動啟動MySQL。 首先執行sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist停止了MySQL,讓我以安全模式登錄。

為了使此工作正常,您需要使用--skip-grant-tables參數啟動mysql服務器。

 /etc/init.d/mysqld restart --skip-grant-tables 

檢查此鏈接以獲取更多信息

B.5.4.1如何重置root密碼

您的初始化腳本也可能不會將其他參數傳遞給mysqld_safe進程。 您應該在進程列表中檢查它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM