LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 02-05-2005, 03:05 PM   #1
lightcom
LQ Newbie
 
Registered: Feb 2005
Posts: 3

Rep: Reputation: 0
MySQL 3.23.58-14 installation prolem - mysql.sock not found


Hi everybody, I used yum to install mysql on FC3, the installation progress was successful, but when I tried to start mysql, it show error "ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)". How can I resolve the problem? Here is the installation progress and the error:

$ yum install mysql
Setting up Install Process
Setting up Repo: base
repomd.xml 100% |=========================| 1.1 kB 00:00
Setting up Repo: updates-released
repomd.xml 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
base : ################################################## 2622/2622
primary.xml.gz 100% |=========================| 273 kB 00:02
MD Read : ################################################## 659/659
updates-re: ################################################## 659/659
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package mysql.i386 0:3.23.58-14 set to be installed
--> Running transaction check

Dependencies Resolved
Transaction Listing:
Install: mysql.i386 0:3.23.58-14
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: mysql 100 % done 1/1

Installed: mysql.i386 0:3.23.58-14
Complete!

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

Please help me. Thanks in advance
 
Old 02-05-2005, 06:33 PM   #2
speck
Member
 
Registered: Nov 2001
Location: California
Distribution: Slackware 14.1
Posts: 281

Rep: Reputation: 55
Is your MySQL server running?
Code:
> ps -eaf | grep mysql | grep -v "grep mysql"
root     30185     1  0 15:31 pts/2    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid
mysql    30209 30185  0 15:31 pts/2    00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --port=3306 --socket=/var/run/mysql/mysql.sock
Also check your /etc/my.cnf configuration file to see where it expects the socket file:
Code:
> grep mysql.sock /etc/my.cnf
socket          = /var/run/mysql/mysql.sock
Speck
 
Old 02-05-2005, 07:56 PM   #3
MikeOliveri
LQ Newbie
 
Registered: Feb 2005
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
I agree with speck - MySQL probably isn't running. Try starting MySQL from your startup script (depends on your distro) and check the output to /var/log/messages. You should get some indication there of what the problem is.

Normally you have to run a couple of commands before MySQL will run. This is the advice given in Slackware:

# Before you can run MySQL, you must have a database. To install an initial
# database, do this as root:
#
# su - mysql
# mysql_install_db
#
# Note that step one is becoming the mysql user. It's important to do this
# before making any changes to the database, or mysqld won't be able to write
# to it later (this can be fixed with 'chown -R mysql.mysql /var/lib/mysql').
 
Old 02-05-2005, 11:00 PM   #4
lightcom
LQ Newbie
 
Registered: Feb 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks all of you, now I have mysqld started. But I have one more question: when I install mysql-max and then start it, it will create /tmp/mysql.sock whereas php_mysql looks for /var/lib/mysql/mysql.sock. The question here is how can tell php_mysql to use /tmp/mysql.sock (I'm just curious because I can make a symbolic link)
 
Old 02-23-2005, 01:46 AM   #5
Dillius
Member
 
Registered: Jan 2004
Location: Georgia
Distribution: Debian Etch
Posts: 99

Rep: Reputation: 15
I am having this problem now, but it seems as if the file mysql.sock does not exist at all.

I have checked my.cnf to see where it should be... and it's not where it should be.

I've tried logging in as the user "mysql", but it will not allow me. I didn't think there was a password set for it but I do nknow it's a suer as i've checked the passwd and shadow files.

mysql_install_db will not work at all.

I'm at a total loss of what to do

EDIT: and yes, i have a process running called "mysql". Though strangely... it is named "mysql" not "mysqld" for the daemon.

EDIT 2: I was wrong. Both exist, but I am unable to access either of them in any way. It will not allow me to kill the processes or restart the mysqld service, even as root.

Last edited by Dillius; 02-23-2005 at 01:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
MySQL server problem after linking (mysql.sock) ewijaya Linux - General 4 01-19-2004 10:46 AM
Mysql Installation on Gentoo - mysqld.sock? Bob Gaskin Linux - Software 1 12-05-2003 12:27 AM
mysql --mysql.sock not found Robin01 Linux - Newbie 2 11-12-2003 12:17 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration