LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL 3.23.58-14 installation prolem - mysql.sock not found (http://www.linuxquestions.org/questions/linux-software-2/mysql-3-23-58-14-installation-prolem-mysql-sock-not-found-286644/)

lightcom 02-05-2005 03:05 PM

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

speck 02-05-2005 06:33 PM

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

MikeOliveri 02-05-2005 07:56 PM

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').

lightcom 02-05-2005 11:00 PM

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)

Dillius 02-23-2005 01:46 AM

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.


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