Forum archive
Database connection Error
While trying to clone the server we are getting the ""Database connection Error"" where the live website is working fine.
root@wordpress www/wordpress# mysql -u wordpress -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Which we managed to fix by creating the socket files.
But facing the below issue now:
root@wordpress ~# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
As it's cloned server we are using the same root password which is used by the live server .
Please help
But you could try rerunning the firstboot script for MySQL to reset the root password. It's something like
/usr/lib/inithooks/bin/mysql.py
Or something similar. Tha path should be correct, just not sure on the filename, perhaps use autocomplete to help the correct filename...?