On my server two websites are hosted (say abc.com and test.xyz.com)
I was trying to rebuild the DB for test.xyz.com and in the process
1.I dropped the database related to it.
2.stopped the mysql ( /etc/init.d/mysqld stop)
3.moved ibdata1 file (/var/lib/mysql/ibdata1) to /tmp/
4. tried to start the mysql
but it is not getting started and on trying to connect to database using terminal, i am getting Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'.
I tried to move back ibdata1 file from /tmp/ to /var/lib/mysql but there was already a file ibdata1. Its a wonder but now website is not working since NO DB connection.
Both the sites stopped working now. Please help
and-
/etc/init.d/mysqld status gives – mysqld (pid 31905) is running…
Thanks
Quick fix:
I’ll explain later, when I have more time, but I think it might be urgent for you to have that quick fix 🙂
UPDATE: (From comments) You can’t connect, okay, the cause for this could be anything. I think the best thing to do (you don’t have much to loose anyway) is you simply kill mysql.
Do
Then
Then do as I said earlier. And never ever simply move ibdata1 again 🙂
Also I’m voting to close as offtopic. Then it’s going to be moved to dba.stackexchange.com which is a partner site that is more dedicated to administrating database servers. You might get better help there.