I was using mysql, trying to add some foreign keys to a database on a Debian server... and all of a sudden I started getting this message:
ERROR 2002 (HY000): Can't connect to l开发者_Python百科ocal MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
No matter what I do, I get this message. If I restart mysql, it just spits this crap out a bunch of times.
I have rebooted the server a bunch of times, and it's not going away. I have no idea what I did... I was just changing the schema of a database that has actually been in production for over a year.
I recently changed the domain name of this server, but mysql was working for a few days after this change.
Beyond that, I can't think of anything I did differently.
Please help. I have to get this database back online.
EDIT: Joy, mysql corrupted my actual database by trying to add foreign keys into a freaking database. The database is toast.
Good thing I have backups, but this is unreal.
This seems to be a useful link. It suggests starting mysql daemon, then type mysql.
/etc/init.d/mysqld start
mysql
If that does not work check the config files for both your mysql client and server to make sure they are pointing to the correct locations.
It turns out that the database was corrupted. If you're also getting an error like this that defies reason, try showing tables and selecting data out of your basic default databases that comes with mysql just to be sure.
In my case, dropping and adding foreign keys actually destroyed my database, which explains why rebooting the server or restarting mysqld was having no effect.
精彩评论