According to this question Access Denied for MYSQL ERROR 1045 I should be able to start MySQL in safe mode with
sudo mysqld_safe --skip-grant-tables
but this simply logs the following lines to STDOUT:
151116 17:46:46 mysqld_safe Logging to '/usr/local/var/mysql/MacBook-Pro.local.err'.
151116 17:46:46 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
151116 17:46:46 mysqld_safe mysqld from pid file /usr/local/var/mysql/MacBook-Pro.local.pid ended
and returns me to the command line. The error log quoted has the same last 2 lines output here. When I try and connect to MySQL I get:
mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
mysqld_safe tries to start an executable named mysqld. To override the default behavior and specify explicitly the name of the server you want to run, specify a --mysqld or --mysqld-version option to mysqld_safe. You can also use --ledir to indicate the directory where mysqld_safe should look for the server.
Execute UPDATE query:Run the UPDATE command without the WHERE clause to check the safe update mode is working or not for the update operation. If the safe update mode is enabled, the error 1175 will be generated for the UPDATE query.
Restart your OS. When restarted check if the MySQL service is no more present the Windows Services (search for services in windows). Be sure no services that use MySQL (application needing access to MySQL) are active. Resinstall MySQL and the service will be able to install itself again.
Just encountered exact same issue on mac. I was able to reset the root password with following steps.
mysqld --skip-grant-tables # this will run mysql
mysql -u root
mysql> FLUSH PRIVILEGES;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
NOTE: Seems like newer version of mysql has error when running 'sudo mysqld_safe --skip-grant-tables'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With