Let me start by saying that I've looked through tons of posts (both here and elsewere on the internet and the article on mysql.com about resetting the admin password) about resetting the mysql password, but nothing seems to work for me. Oh, i'm also fairly new to working on the command line.
Below the 'solution' that seems to work for everyone, but not for me:
Last login: Mon Nov 3 12:02:21 on console
maurice@Maurices-MacBook-Pro:~$ sudo /usr/local/mysql/support-files/mysql.server stop
Password:
Shutting down MySQL
. SUCCESS!
maurice@Maurices-MacBook-Pro:~$ sudo mysqld_safe --skip-grant-tables
141103 12:25:35 mysqld_safe Logging to '/usr/local/mysql/data/Maurices-MacBook-Pro.local.err'.
141103 12:25:35 mysqld_safe A mysqld process already exists
maurice@Maurices-MacBook-Pro:~$
I don't know where that other process is coming from and i have no clue on how to close that. If i continue to follow the instructions and open a new console tab i get the following:
Last login: Mon Nov 3 12:25:16 on ttys000
maurice@Maurices-MacBook-Pro:~$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
maurice@Maurices-MacBook-Pro:~$ sudo mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
maurice@Maurices-MacBook-Pro:~$
I can't get into mysql to update the password. I can communicate with MySQL via the mysql
command, but (of course) i can't do any queries:
maurice@Maurices-MacBook-Pro:~$ 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> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user'
mysql>
I've spent the whole yesterday evening searching for solutions, but can't find anything anywhere. Please remember that i'm fairly new to working on the command line, so if i overlook something really basic; sorry!
I really hope someone knows a solution, because i'm out of options
Edit (solution):
Paul Haldane pointed me in the right directions. I forgot that i've added an com.mysql.mysql.plist
file that i loaded via launchctl on startup to autostart MySQL on startup. First doing an sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysql.plist
stopped MySQL and let me login in safe mode.
So happy right now :)