I can't get access to my MySQL databases. Problem:
root@server:~# mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Trying to reset password:
- /etc/init.d/mysql stop
- mysqld_safe --skip-grant-tables &
leads to:
root@server:~# ... mysqld_safe Logging to syslog. ... mysqld_safe Logging to '/var/log/mysql/error.log'. ... mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
as a result:
root@server:~# mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
root@server:~# mysql -u root -p
Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)