parlays
asked on
Can't start MySQL server on Ubuntu?
Hello everybody!
I recently made a mistake and messed up my MySQL server on my local Ubuntu machine. I've tried everything to get it to work but can't. I uninstalled and reinstalled it but can't get it back to normal.
When I run '/etc/init.d/mysql start' it always says fail. Weird thing is if I run that command with Sudo it starts the server.
Any advice on how to restore things and fix this is much appreciated.
I recently made a mistake and messed up my MySQL server on my local Ubuntu machine. I've tried everything to get it to work but can't. I uninstalled and reinstalled it but can't get it back to normal.
When I run '/etc/init.d/mysql start' it always says fail. Weird thing is if I run that command with Sudo it starts the server.
Any advice on how to restore things and fix this is much appreciated.
Need to be root to start Mysql Server ... or use sudo instead
ASKER
Gotcha, thanks guys.
The problem is that when i run 'mysql' or 'mysqladmin' from the command line it says
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
It cannot find it because the location of the socket file is:
'/var/run/mysqld/mysqld.so ck'
All of the settings in the my.cnf file point to '/var/run/mysqld/mysqld.so ck', so I have no idea how to get it to check that folder instead of 'tmp/mysql.sock'. Maybe I am missing a config file or something.
The way I am getting it to work now is to set up a symbolic link from the 'tmp/mysql.sock' location to the actual socket file and that works.
But I would like to fix it the right way and have it look for the actual file. Thanks!
The problem is that when i run 'mysql' or 'mysqladmin' from the command line it says
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
It cannot find it because the location of the socket file is:
'/var/run/mysqld/mysqld.so
All of the settings in the my.cnf file point to '/var/run/mysqld/mysqld.so
The way I am getting it to work now is to set up a symbolic link from the 'tmp/mysql.sock' location to the actual socket file and that works.
But I would like to fix it the right way and have it look for the actual file. Thanks!
I think this is how you will solve this issue ....
http://hervalicio.us/blog/2007/07/07/no-such-file-or-directory-tmpmysqlsock/
http://hervalicio.us/blog/2007/07/07/no-such-file-or-directory-tmpmysqlsock/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
again ... simply ... do
ln -sf /var/run/mysql/mysqld.sock /tmp/mysql.sock
ln -sf /var/run/mysql/mysqld.sock
agamal: author already did that - see http:#a23665293, but as far as I can see, he wants to avoid this workaround.
that is exactly i don't understand ... this is not a work around this is the solution to this case over google :D:D
any way good luck :-)
any way good luck :-)
ASKER
I guess I did more research and found that the my.cnf file was missing in the /etc directory. There was one in the /etc/mysql directory so I created a symbolic link to that one.
I guess the MySQL client made a mistake when installing and pointed to the main /etc direcotyr.
I guess the MySQL client made a mistake when installing and pointed to the main /etc direcotyr.
If provided suggestions was helpful, they should be accepted as a solution or at least assisted solution.
I wrote about checking which files are read during mysqld startup (strace command), and as I see I was right - proper my.cnf hadn't been read by mysqld, therefore I have to object on closing this question without accepting my comment as at least assisted solution.
I wrote about checking which files are read during mysqld startup (strace command), and as I see I was right - proper my.cnf hadn't been read by mysqld, therefore I have to object on closing this question without accepting my comment as at least assisted solution.
What is exact command when this command fails?
You may also look at your mysql error log file.