Results 1 to 10 of 11
I get this error whenever I try to connect to mysql. This error also appears when I type
<code>mysql -p root</code>
root@slackware:/var/run/mysql# mysql
ERROR 2002: Can't connect to local MySQL ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-30-2005 #1Just Joined!
- Join Date
- Mar 2005
- Posts
- 45
mysql cannot connect error.
I get this error whenever I try to connect to mysql. This error also appears when I type
<code>mysql -p root</code>
root@slackware:/var/run/mysql# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
- 04-30-2005 #2
try connecting with:
-u tells mysql server what username to use, and the -p (wqith nothing after it) tells the server to prompt for a passwordCode:mysql -u root -p
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 04-30-2005 #3Just Joined!
- Join Date
- Apr 2005
- Posts
- 40
Have you installed initial database?
Code:su - mysql mysql_install_db
- 04-30-2005 #4Just Joined!
- Join Date
- Mar 2005
- Posts
- 45
I tried installing the initial database, but I still get the same error when I do
I also set a root mysql password already. Whenever I turn on the computer, it also says that mysql has shut down. I will post the exact error when I canCode:mysql -u root -p
- 05-01-2005 #5This could be a problem, if the mysql server isn'#t up and running, u cant connect to it. try:
Originally Posted by mr.popper
to start the mysql server, then try theCode:/etc/init.d/mysql start
commandCode:mysql -u root -p
"I am not an alcoholic, alcoholics go to meetings"
Registered Linux user = #372327
- 05-02-2005 #6Just Joined!
- Join Date
- Dec 2004
- Location
- Dallas
- Posts
- 10
I have a feeeling you could be getting the error that is caused by bad permissions in the mysql directory. Try this command out:
Code:chown -R mysql:mysql /var/lib/mysql
- 05-04-2005 #7Just Joined!
- Join Date
- Mar 2005
- Posts
- 45
apparently there is no such directory as
/etc/init.d/mysql
I found it in /usr/bin/mysql
if I do /usr/bin/mysql start, I get the same error as always. I also tried chown-ing that folder, but with the same result.
- 05-04-2005 #8Linux Newbie
- Join Date
- Jan 2004
- Location
- Belgrade, S&M
- Posts
- 177
Try this:
Does it work ?Code:(as root) chown +x /etc/rc.d/rc.mysqld /etc/rc.d/rc.mysqld start myswl_install_db mysql -u root -p
- 05-04-2005 #9Just Joined!
- Join Date
- Mar 2005
- Posts
- 45
that worked, thanks! How do I get mysqld to start on boot?
- 05-04-2005 #10Just Joined!
- Join Date
- Apr 2005
- Posts
- 40
Code:chmod 755 /etc/rc.d/rc.mysqld


Reply With Quote
