LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-18-2008, 09:54 AM   #1
warun
Member
 
Registered: Aug 2007
Posts: 39

Rep: Reputation: 15
mysql on slackware


hello everyone,

i am using slackware 12.1. i intend to use mysql on slackware but i get this error message

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

i tried to see if the mysql deamon is running through the command chkconfig but looks like slackware does not identify this command. what is the equivalent command in slackware or how do i go about this problem?

thanks in advance
 
Old 10-18-2008, 10:00 AM   #2
niels.horn
Senior Member
 
Registered: Mar 2007
Location: Rio de Janeiro - Brazil
Distribution: Slackware64-current
Posts: 1,004

Rep: Reputation: 91
Check if mysql is running by typing:
Code:
ps -A | grep mysql
Did you run the mysql_secure_installation script and make rc.mysqld executable?
 
Old 10-18-2008, 10:02 AM   #3
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Code:
pidof mysqld
This will give you the process ID of the MySql daemon if it's running.

MySql won't work in Slackware without setting it up - have a look at the file /etc/rc.d/rc.mysqld for instructions - it's well commented and will show you how to set up starting databases and things.

edit: sorry neils - you beat me to it !!
 
Old 10-18-2008, 10:04 AM   #4
robel
Member
 
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 77

Rep: Reputation: 19
Quote:
Originally Posted by warun View Post
hello everyone,

i am using slackware 12.1. i intend to use mysql on slackware but i get this error message

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)

i tried to see if the mysql deamon is running through the command chkconfig but looks like slackware does not identify this command. what is the equivalent command in slackware or how do i go about this problem?

thanks in advance
First, you have to set execute permissions to /etc/rc.d/rc.mysqld

Second, you have to run mysql_install_db --user=mysql

Read this thread: http://www.linuxquestions.org/questi...roblem-417127/
 
Old 10-18-2008, 10:26 AM   #5
warun
Member
 
Registered: Aug 2007
Posts: 39

Original Poster
Rep: Reputation: 15
As suggested i went thru the file /etc/rc.d/rc.mysqld and accordingly did these

1. gave execute permissions to /etc/rc.d/rc.mysqld
2. executed mysql_install_db --root=mysql

After this when i try using mysql as mysql -u root the same error appears

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
 
Old 10-18-2008, 10:45 AM   #6
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
OK - I've just ran through the instructions on a clean VM of Slack 12.1 and it worked fine.

So -- you did restart after making your changes ? If so what messages about mysql did you see late on in the boot process ? Can you rerun
pidof mysqld as root to check it's running ?

Last edited by bgeddy; 10-18-2008 at 11:11 AM.
 
Old 10-18-2008, 11:17 AM   #7
warun
Member
 
Registered: Aug 2007
Posts: 39

Original Poster
Rep: Reputation: 15
yes i restarted after making the changes. mysqld did run at the boot time with following messages

starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
081018 21:39:42 mysql ended.

and ya pidof mysqld didn't return anything

Last edited by warun; 10-18-2008 at 11:21 AM.
 
Old 10-18-2008, 11:54 AM   #8
robel
Member
 
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 77

Rep: Reputation: 19
Quote:
Originally Posted by warun View Post
yes i restarted after making the changes. mysqld did run at the boot time with following messages

starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
081018 21:39:42 mysql ended.

and ya pidof mysqld didn't return anything
Do you see any errors in /var/lib/mysql/*.err ?

(exchange * with your server name)

It should be just the command mysql on the server to test it. Remote doesn't work by default. Read /etc/rc.d/rc.mysqld
 
Old 10-18-2008, 12:01 PM   #9
warun
Member
 
Registered: Aug 2007
Posts: 39

Original Poster
Rep: Reputation: 15
the error message in /var/lib/mysql/*.err was

081018 22:09:01 mysqld started
081018 22:09:03 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
081018 22:09:03 mysqld ended
 
Old 10-18-2008, 12:34 PM   #10
robel
Member
 
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 77

Rep: Reputation: 19
Try this:

/etc/rc.d/rc.mysqld stop ; rm -fR /var/lib/mysql/* ; mysql_install_db --user=mysql ; /etc/rc.d/rc.mysqld start

and then

cat /var/lib/mysql/*err

still the same error ?
 
Old 10-18-2008, 02:45 PM   #11
drauk
Member
 
Registered: Sep 2007
Location: /MX/BC/TJ
Distribution: Slackware 13
Posts: 37

Rep: Reputation: 15
Quote:
Originally Posted by warun View Post
yes i restarted after making the changes. mysqld did run at the boot time with following messages

starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/run/mysql/mysql.pid
081018 21:39:42 mysql ended.

and ya pidof mysqld didn't return anything
try chown mysql:mysql -R /var/lib/mysql
 
Old 11-28-2008, 01:02 PM   #12
Ho0ligaN
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
I am having the exact same problem with mysql, how do I get around this problem?

Quote:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)
 
Old 11-28-2008, 05:21 PM   #13
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,671

Rep: Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788
after installation of MySQL, you should run
Code:
mysql_install_db --user=mysql
or another solution is:
Code:
chmod -R 755 /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
 
Old 11-29-2008, 07:42 AM   #14
Ho0ligaN
LQ Newbie
 
Registered: Nov 2008
Posts: 9

Rep: Reputation: 0
Hey I tried that but still no use


EDIT: Hey I had forgotten to restart mysqld, its working fine once mysqld was restarted..

I have a new question now, its not regarding mysql though, how do I set classpath for tomcat? I have downloaded apache-tomcat-6.0.18.tar.gz(which I used on my previous two distros also, mandriva 2009 and opensuse 11.0), now I have extracted to /home/user directory, I ran ./startup.sh and the server is indeed up and running. but I cant seem to find .bash_profile file to set classpath(like I did in my previous two installs).. there's only a .bash_history file. Also, there is no servlet api .jar file in /usr/share/java :-S

Last edited by Ho0ligaN; 11-29-2008 at 08:26 AM.
 
Old 11-29-2008, 06:30 PM   #15
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,671

Rep: Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788Reputation: 1788
you can make it yourself using
Code:
touch .bash_profile
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
MySQL in SlackWare MaMatO Slackware 10 10-16-2003 08:21 AM
Slackware + MySQL stuart39 Slackware 5 10-07-2003 03:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration