SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Hey guys i was following along these steps i have here to installing a mysql database to my slackware box. I am at the step now where i need to run mysql and i get this error.
mysql@Trigun:/usr/local/mysql/data$ mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
mysql@Trigun:/usr/local/mysql/data$
When i go to '/var/run/mysql/' I dont even see any files in this dir. Does this mean i did not install everything correctly. Also if you need the in which i took for this is needed i can upload the pdf i was using.
You will want to have mysql running first, so since you copied that script to /etc/rc.d you can start it with:
/etc/rc.d/mysql start
And after that, try connecting again.
harold@Trigun:~$ su root
Password:
root@Trigun:/home/harold# /etc/rc.d/mysql start
root@Trigun:/home/harold# Starting mysqld daemon with databases from /usr/local/mysql/data
030709 05:59:05 mysqld ended
tee: /usr/local/mysql/data/Trigun.err: No space left on device
tee: /usr/local/mysql/data/Trigun.err: No space left on device
root@Trigun:/home/harold# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
root@Trigun:/home/harold#
You could install mysql elsewhere, maybe /usr/mysql since / has enough space that might be worth trying.
You will need/want to edit the startup script, and probably need to edit mysql_install_db as well to the new location. Re-do the install, make sure everything goes well, and then try starting it again.
mysql@Trigun:/var/run/mysql$ /etc/rc.d/mysql start
mysql@Trigun:/var/run/mysql$ Starting mysqld daemon with databases from /usr/local/mysql/data
030709 08:50:33 mysqld ended
mysql@Trigun:/var/run/mysql$ mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
mysql@Trigun:/var/run/mysql$
i even chmoded the mysql folder to 777 and it still gives me this error. I will check on google to see if some one has a mock mysql.sock i can import into this folder. But if some one knows the answer to why i am getting this please let me know :-D
Originally posted by digital bots mysql@Trigun:/var/run/mysql$ /etc/rc.d/mysql start
mysql@Trigun:/var/run/mysql$ Starting mysqld daemon with databases from /usr/local/mysql/data
030709 08:50:33 mysqld ended
mysql@Trigun:/var/run/mysql$ mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
mysql@Trigun:/var/run/mysql$
i even chmoded the mysql folder to 777 and it still gives me this error. I will check on google to see if some one has a mock mysql.sock i can import into this folder. But if some one knows the answer to why i am getting this please let me know :-D
You have to have it running with no errors before trying to connect to it.
Try:
chown -R mysql.mysql /var/run/mysql
safe_mysqld &
Then if it doesn't error out.. you can connect to the database with:
same thing i have done this like 3 times before on other machines and i never got any errors. Could it be the version of mysql database i am using?
root@Trigun:/var/run# safe_mysqld &
[1] 4634
root@Trigun:/var/run# Starting mysqld daemon with databases from /var/lib/mysql
030710 09:51:59 mysqld ended
[1]+ Done safe_mysqld
root@Trigun:/var/run# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (111)
root@Trigun:/var/run#
What do your logs tell you in why it keeps ending after attempting to start? Do you have any databases in /var/lib/mysql ?? Have you tried removing any of them and redoing the steps:
And there is no use in trying to connect with the mysql command until you actually getting it to run, that will keep giving an error til you can actually run the safe_mysqld command.
This is how I got mysql working thanks to initself
Set permissions on MySQL files:
# cd /var/lib
# chown -R mysql:root mysql
# su mysql
$ mysql_install_db
$ safe_mysqld --user=mysql & [hit enter once the db loads]
$ exit
# mysqladmin -u root status [verify the database is running]
Add MySQL to startup scripts::
# vi /etc/rc.d/rc.local
echo Starting MySQL server:
safe_mysqld &
sleep 2
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.