LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware and mysql (https://www.linuxquestions.org/questions/slackware-14/slackware-and-mysql-71194/)

digital bots 07-09-2003 03:57 AM

Slackware and mysql
 
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.

MasterC 07-09-2003 04:06 AM

What steps? :) Could you explain what steps you've taken so far?

Cool

digital bots 07-09-2003 04:32 AM

ok here is what i did all of this i did as root

$ cp mysql-standard-4.0.13-pc-linux-i686 /usr/local
$ cd /usr/local
$ tar -zxvf mysql-standard-4.0.13-pc-linux-i686

$ ln -s mysql-standard-4.0.13-pc-linux-i686 mysql

$ cd /usr/local
$ chown -R mysql:root mysql-standard-4.0.13-pc-linux-i686 mysql

$ su mysql
$ cd mysql
$ scripts/mysql_install_db
$ exit

$ cd /etc/rc.d
$ cp /usr/local/mysql/support_files/mysql.server mysql
$ chmod +x mysql

and this part didnt work because slackware doesnt have a chkconfig so i think this is where it could have gone wrong

$ /sbin/chkconfig --del mysql
$ /sbin/chkconfig --add mysql

$ mysql

and then i got that error

MasterC 07-09-2003 04:35 AM

Yep :)

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.

Post back if you still have errors.

Cool

digital bots 07-09-2003 04:59 AM

i get this now

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#

MasterC 07-09-2003 05:02 AM

You need to figure out why mysql is ending so abruptly, judging from those errors, you are short on space ;)

Look at df -h to find out for sure.

Cool

digital bots 07-09-2003 05:58 AM

root@Trigun:/home/harold# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda5 7.3G 2.1G 4.9G 30% /
/dev/hda1 45M 46M 0 100% /usr/local
root@Trigun:/home/harold#

yup i am outta space in my local users area. Is there anyway around this?

MasterC 07-09-2003 07:25 AM

Yes, of course ;)

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.

Cool

digital bots 07-09-2003 07:52 AM

ok i fixed the size problem

mysql@Trigun:/var/run/mysql$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda5 7.3G 2.1G 4.9G 30% /
/dev/hda1 45M 34M 9.6M 78% /usr/local
mysql@Trigun:/var/run/mysql$

but i still get the same here is what i did.

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

trickykid 07-09-2003 08:49 AM

Quote:

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:

mysql

digital bots 07-10-2003 07:22 AM

Still nothing i dont think my pc likes me.

root@Trigun:/var/run# chown -R mysql.mysql /var/run/mysql
root@Trigun:/var/run# safe_mysql &
[1] 2741
root@Trigun:/var/run# bash: safe_mysql: command not found

[1]+ Exit 127 safe_mysql
root@Trigun:/var/run# /etc/rc.d/mysql start
root@Trigun:/var/run# Starting mysqld daemon with databases from /usr/local/mysql/data
030710 08:21:17 mysqld ended


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#

trickykid 07-10-2003 08:40 AM

You didn't look closely.. the command safe_mysql has a d on the end:

safe_mysqld &

digital bots 07-10-2003 08:53 AM

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#

trickykid 07-10-2003 09:05 AM

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:

mysql_install_db
chown -R mysql.mysql /var/lib/mysql
safe_mysqld &

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.

naflan 07-10-2003 09:14 AM

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

see post


All times are GMT -5. The time now is 07:03 PM.