DevWeb's picture

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

Jeremy Davis's picture

But you could try rerunning the firstboot script for MySQL to reset the root password. It's something like 


Or something similar. Tha path should be correct, just not sure on the filename, perhaps use autocomplete to help the correct filename...?

John Peterson's picture

Thanks for the quick reply Jeremy. I am working with DevWeb on this particular issue. The backgroud on this is that we are cloning an existing WordPress 12.1 amd64 server using the restore functionality with TKLBAM backups. We have used tklbam many times on WordPress 12.0 x86 with no issues. However, with the new WordPress 12.1 amd64 server we're seeing this error every time. Between several team members we followed the same internal process about ~10-times per server and got the same error every time. The workaround is to use snapshots for creating clones of servers. I hope that helps. We wanted to make sure to submit this error so that the error with TKLBAM was brought to light.

Jeremy Davis's picture

Thanks for the additional info. I wasn't clear that this was something that you had working previously and that your existing system now no longer works...

I have contacted the core devs in the hope that they can have a quick look over it and see if they can pinpoint it. 

Yosi Mor's picture

Looks like a duplicate of the problem reported here:

... for which the following issue was opened on the TurnKey Dev Tracker on GitHub:

Add new comment