LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-05-2004, 06:35 PM   #1
brokenflea
Member
 
Registered: Nov 2003
Distribution: Slackware 11.0, FreeBSD
Posts: 284

Rep: Reputation: 30
MySQL Error


i've installed mysql-4.0.20 on my slack 10 machine and everytime i try to run /usr/local/bin/mysql
it comes up with this error:

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

i've googled up this error and everything i've done doesn't work.... please help

TIA
 
Old 08-05-2004, 06:42 PM   #2
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
Is it running? Try "ps -e | grep mysql" to see if processes are running.
Make sure /etc/rc.d/rc.mysqld is executable.
You can start it using:
/etc/rc.d/rc.mysqld start

(or restart instead of start.)
 
Old 08-05-2004, 06:44 PM   #3
brokenflea
Member
 
Registered: Nov 2003
Distribution: Slackware 11.0, FreeBSD
Posts: 284

Original Poster
Rep: Reputation: 30
i don't see a rc.mysqld file in the /etc/rc.d directory..... i know i messed up somewhere, but is the file automatically generated or do i have to make up a script ?
 
Old 08-05-2004, 06:47 PM   #4
shilo
Senior Member
 
Registered: Nov 2002
Location: Stockton, CA
Distribution: Slackware 11 - kernel 2.6.19.1 - Dropline Gnome 2.16.2
Posts: 1,132

Rep: Reputation: 50
Maybe this will help:

http://www.unixfool.com/mysql-slack.shtml

/etc/rc.d/rc.mysqld is automatically generated. Did you use the official Slackware package to install mysql?

Last edited by shilo; 08-05-2004 at 06:50 PM.
 
Old 08-05-2004, 06:56 PM   #5
brokenflea
Member
 
Registered: Nov 2003
Distribution: Slackware 11.0, FreeBSD
Posts: 284

Original Poster
Rep: Reputation: 30
ok, i finally managed to copy the executable script from mysql/support-files to /etc/rc.d , and i have the daemon running, but when i try to do /usr/local/bin/mysql, it comes up as :

ERROR 1045: Access denied for user : 'root@localhost' (Using password: NO)

i know this has something to do with the mysql user, but i'm stuck in a rut with this one.
thanks for all your help
 
Old 08-12-2004, 11:44 AM   #6
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
I'm getting a similar problem.

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

I did the mysql_install_db thing like it said at http://www.unixfool.com/mysql-slack.shtml, it does it without any errors, but then when I type mysql again, it shows the same old error. I had this problem when I installed Slack 9.1, official packages. Now I'm having the exact same problem after doing a clean install of slack 10.
 
Old 08-12-2004, 11:51 AM   #7
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Hey TBomb do you have a firewall running? MySQL needs port 3306 to work trough socket.
brokenflea, that means that you have to supply a password when trying to connect, if i don't remember wrong you have to issue the mysql command with the -p parameter.
 
Old 08-12-2004, 11:56 AM   #8
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
I don't have a firewall running locally, but on my router. But I'm running this command locally, so I don't see how thats effecting it.
 
Old 08-12-2004, 11:58 AM   #9
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
I checked the /var/run directory, which is where the error says it can't connect to. The directory is completely empty.
 
Old 08-12-2004, 12:09 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Check your mysql config file and see if you have this:
Code:
# The following options will be passed to all MySQL clients
[client]
port            = 3306
socket          = /var/run/mysql/mysql.sock

# The MySQL server
[mysqld]
port            = 3306
socket          = /var/run/mysql/mysql.sock
And this line must not exist or be commented like here (i'm talking about skip-networking line):
Code:
 # Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (using the "enable-named-pipe" option) will render mysqld useless!
# 
#skip-networking
By the way, it's strange that you have /var/run empty, a lot of programs (like Apache, Samba, SSH) uses it as a holding directory for their pids or socks.

Last edited by gbonvehi; 08-12-2004 at 12:11 PM.
 
Old 08-12-2004, 12:15 PM   #11
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
I checked the /var/run directory
re-check it as root

Make sure /var/lib/mysql is assigned to mysql user and mysql group, and all the files and subdirectories in it too.
 
Old 08-12-2004, 12:36 PM   #12
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
damnit, I can't even start up KDE now. My computer was booting into gnome rather than KDE, so I changed /etc/rc.d/rc.4 and removed the gnome entry, so that it would load kde by default.

Just rebooted and it's still going to the gnome login manager, I tried logging in again to change the file again, but it just freezes when the gnome logo appears.

(nvm - fixed this)

Last edited by TBomb; 08-12-2004 at 12:39 PM.
 
Old 08-12-2004, 12:41 PM   #13
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
I rechecked /var/run as root. It isn't empty, however there is no mysql.sock there, however there is a mysql directory, which is also empty.

The permissions of /var/lib/mysql is set to:

Owner: Can view & modify content
Group: Can view content
Other: Forbidden

Ownership:
User: mysql
Group: mysql

Last edited by TBomb; 08-12-2004 at 12:43 PM.
 
Old 08-12-2004, 01:08 PM   #14
TBomb
Member
 
Registered: May 2004
Location: Great Britain
Distribution: Slackware
Posts: 91

Rep: Reputation: 15
All fixed When I changed the permissions of the directory, I assumed it would automaticly change the permissions of all files and folders under it, it didn't. Changed them all manually and it works!
 
Old 08-12-2004, 01:12 PM   #15
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
You can always use the -R switch (with caution) in this case

chown -R mysql:mysql /lib/mysql
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
Starting MySQL OLD Error : imeout error occurred trying to start MySQL Daemon Fr33B5D Linux - Software 9 10-28-2006 06:23 AM
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
Error compiling perl-DBD-MySQL after upgrading to MySQL 4.1 pitaro920 Linux - Software 1 01-16-2006 04:28 PM

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

All times are GMT -5. The time now is 07:50 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