Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 checked that directory, its empty
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
Any ideas? Once I can find this file, I'll update my.cnf and it should be OK
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.
Last edited by Wim Sturkenboom; 11-15-2009 at 05:13 AM.
Reason: OOPS, had the wrong service (httpd) instead of 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]
password: [enter pass][enter]
I think that is the sequence. I rarely get mysql to connect if I pass the password on the initial command line. Also, make sure you have created the initial root user [examples are in the readme's - not sure where slackpkg puts mysql.
Doesn't slack come with mysql already as an installable package? I would look for that on the install cd's.
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)
3) If you've never run mysql before on the machine, you need to run the mysql_install_db as root to initialize stuff
Unless the script in Slackware 13 has changed compared to previous versions, please do NOT run it as root. Login as root, issue su - mysql and next run the script.
If you run as root, the owner/group and permissions are not correct.
Unless the script in Slackware 13 has changed compared to previous versions, please do NOT run it as root. Login as root, issue su - mysql and next run the script.
If you run as root, the owner/group and permissions are not correct.
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
# database, do this as root:
#
# mysql_install_db --user=mysql
That does the same thing as your su suggestion I believe.
/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 ;-]
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
FOA, make sure you've read /etc/rc.d/rc.mysqld - it's got basic info on mysql in Slackware. Then, follow basic steps already posted above (and shown in rc.mysqld).
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.