[Solved] MySQL

You have a problem with Salix? Post here and we'll do what we can to help.
Post Reply
scheelga
Posts: 3
Joined: 18. Jan 2010, 15:31

[Solved] MySQL

Post by scheelga »

Hello All,

I am new to Salix and slackware. I've installed MySQL and checked the box for mysqld in the 'Startup Services' dialog. However, it does not appear to be starting:

Code: Select all

glen[~]$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
Any ideas?
Last edited by scheelga on 19. Jan 2010, 01:33, edited 1 time in total.
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: MySQL

Post by thenktor »

Run the following to make the mysql start script executable:
chmod +x /etc/rc.d/rc.mysql

You also have to change ownership for the database:
chown -R mysql:mysql /var/lib/mysql

After that start mysql with:
/etc/rc.d/rc.mysql start

Then you are ready to initilize your mysql database with the usual tools.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: MySQL

Post by damNageHack »

thenktor, you are absolutely right.

But you should know the "service" command and make some advertisement for it ... Shame on you :oops: :roll:
man service wrote: NAME
service - a command line tool that helps with management of system ser‐
vices
(...)
service is part of the salixtools package.
(...)
AUTHORS
· George Vlahavas <vlahavas~at~gmail~dot~com>

service started as a fork of the service script originally written by:

· Jean-Philippe Guillemin <jp.guillemin~at~free~dot~fr>
It makes the job more easy (get root rights for it):

Code: Select all

# chown -R mysql:mysql /var/lib/mysql
# service restart mysql
Maybe a "service start" only will do the trick also.

But the user wrote he did check the box for mysql service to start, then it was maybe only the file rights problem.

Sorry, no problem. Only wanted to add this because the tool is great and some help towards more usability :lol:
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
scheelga
Posts: 3
Joined: 18. Jan 2010, 15:31

Re: MySQL

Post by scheelga »

I've tried both methods and it seems to start and then immediately stop.

Code: Select all

root[glen]# chmod +x /etc/rc.d/rc.mysqld
root[glen]# chown -R mysql:mysql /var/lib/mysql
root[glen]# /etc/rc.d/rc.mysqld start
root[glen]# nohup: redirecting stderr to stdout
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
100118 09:51:09  mysqld ended

Code: Select all

root[glen]# service start mysqld
Starting the mysqld service
Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
100118 09:52:08  mysqld ended
Thanks for your help so far.
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: MySQL

Post by damNageHack »

Code: Select all

100118 09:52:08  mysqld ended
I asked google for "100118 mysqld" and got this bug report:
http://bugs.mysql.com/bug.php?id=50419

Maybe check your logs if you have the same messages.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
jpg153
Donor
Posts: 449
Joined: 23. Oct 2009, 15:43
Location: Krefeld/NRW/BRD/EU

Re: MySQL

Post by jpg153 »

Hi,

what is this
pid file /var/run/mysql/mysql.pid
file for?

Is it causing to stop the engine? Why is it there and what is its original purpose?
Regards Gruß
jpg
Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: MySQL

Post by Shador »

Try: rm -f /var/run/mysql/mysql.pid
And then start mysql.

Otherwise can you run (and post the complete output):

Code: Select all

bash -x /etc/rc.d/rc.mysqld start
Image
User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: MySQL

Post by thenktor »

Did you initialize your database?
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)
scheelga
Posts: 3
Joined: 18. Jan 2010, 15:31

Re: MySQL

Post by scheelga »

No, I had not initialized it and that was part of the problem. I found an error log in /var/lib/mysql and googling the last error before the server shutdown led me to the MySQL forum and it turned out that the solution was:

Code: Select all

rm -rf /var/lib/mysql
cd /usr/lib
./mysql_install_db --user=mysql --ldata=/var/lib/mysql 
chown -R mysql:mysql /var/lib/mysql
/etc/rc.d/rc.mysqld start


Thanks to all for the suggestions.
User avatar
JRD
Salix Warrior
Posts: 950
Joined: 7. Jun 2009, 22:52
Location: Lyon, France

Re: [Solved] MySQL

Post by JRD »

All this is explained in /usr/doc/mysql !
Image
Post Reply