Slack13 - Can't start mysql; can't find mysql.sock?
I've installed slackware 13.0 on virtual box
I've then installed mysql by running Code:
slackpkg install package mysql I have created a mysql user and group, and can verify these by su'ing to the mysql user or checking /etc/password When I try to run mysql, using mysql I get the following Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) I've done some googling regarding that missing sock file and apparently it can be in a number of places depending on your distro, but I still couldn't find it. Also tried the following with no luck (may be incorrect command) Code:
find / -u mysql.sock | cat > searchResults |
The error usually means that you don't have mysqld ruuning. I'm not familiar with version 13, but in earlier Slackware releases you had to make /etc/rc.d/rc.mysqld executable and start it.
Please read that script first as it contains instructions how to setup the initial databases. |
...
|
On my slackware 12 box, its /etc/rc.d/rc.mysqld that starts mysqld
|
mysql.sock gets created _once_ mysqld starts up and is able to bind to the port. If I am not misaken, you usually have to star mysqld as root, and it will "switch" to the mysql user [much like apache does when it switches to the user apache after starting].
o are you starting mysql as root? You might try it if not. o make sure you have not created a funky 'data' directory for mysql. The .sock file gets created there and expects any parent directories to be in place. o also, make sure you are starting mysql [the client part], passing in the correct info: Code:
$ mysql -u user -p [enter] Doesn't slack come with mysql already as an installable package? I would look for that on the install cd's. --steve |
Getting mysql running on slackware requires 3 steps
1) Creating a my.cnf from one of the my-*.cnf examples in /etc 2) Making /etc/rc.d/rc.mysqld executable and starting it (by the way, you need to edit this file if you want to access mysql over tcp/ip rather than via a socket). 3) If you've never run mysql before on the machine, you need to run the mysql_install_db as root to initialize stuff In addition it is a really good idea to set a password for the root mysql user (which is NOT the same thing as the system root user) |
Quote:
If you run as root, the owner/group and permissions are not correct. |
Quote:
You're right, I was forgetting an important part that is explained in /etc/rc.d/rc.mysqld Code:
# Before you can run MySQL, you must have a database. To install an initial |
/egrep stands corrected - I have not run mysqld on slack for a long time. On the Red Hat work systems, the mysql user does not exist so we have to set up permissions manaully. Maybe we should push to have the app id added ;-]
--steve |
Quote:
|
jayla, as stated by hangdog42, you need to go into /etc directory and see if you've an existing my.cnf that needs to be configured. If there are only the my-*.cnf files, you'll need to select and configure one. At the same time, you need to check the .cnf file for the directory that the mysql.socket will be located.
Hope this helps you. |
I have similar problem
mysql is not working or I do not know ? I am able to access it by "mysql" shell command, but I can not access by phpmyadmin ... or so I made Code:
ln -s /var/run/mysql/mysql.sock /tmp/mysql.sock I do not know why this is needed, here is my /etc/my.cnf Code:
root@serv:/etc# cat /etc/my.cnf |
All times are GMT -5. The time now is 03:39 AM. |