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)
Printable View
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)
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
Have you installed initial database?
Code:su - mysql
mysql_install_db
I tried installing the initial database, but I still get the same error when I doI 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
This could be a problem, if the mysql server isn'#t up and running, u cant connect to it. try:Quote:
Originally Posted by mr.popper
to start the mysql server, then try theCode:/etc/init.d/mysql start
commandCode:mysql -u root -p
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
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.
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
that worked, thanks! How do I get mysqld to start on boot?
Code:chmod 755 /etc/rc.d/rc.mysqld