Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2
Hello,
I work under Redhat 4.0, By default, I installed the packages Mysql and Apache. I have no problem to start Apache ... However, I can not start Mysql, I have the error:
Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2
I think, there is a problem of installing MySQL. The file/var/lib/mysql/mysql.sock does not exist, the directory var/lib/mysql is not!
When I type the command: whereis mysql
HTML Code:
mysql:/usr/bin/mysql/usr/lib/mysql/usr/include/mysql/usr/share/mysql/usr/share/man/man1/mysql.1.gz
When I type the command: rpm-qa | grep mysql
HTML Code:
mysql-4.1.20-2.RHEL4.1.0.1
mysql-devel-4.1.20-2.RHEL4.1.0.1
perl-DBD-mysql-4008-1.el4.rf
mysqlclient10-3.23.58-4.RHEL4.1
libdbi-dbd-mysql-0.6.5-10.RHEL4.1
mysqlclient10-3.23.58-4.RHEL4.1
mysql-4.1.20-2.RHEL4.1.0.1
What should I do to resolve this error and start mysql?
Do I have to uninstall and reinstall mysql mysql?
Thank you in advance for your help
Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2
First of all, install the database in MySQL: To solve this problem, just follow these steps:
HTML Code:
# Mysql_install_db
Next you need to generate the sock:
HTML Code:
# Chown-R mysql.mysql/var/lib/mysql
Now let's start in the MySQL server:
HTML Code:
# Safe_mysqld &
your MySQL is already running!
Open another terminal window and type:
Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2
Thank you for responding so quickly
I have no file /var/log/mysqld.log
There are no files on my server mysqld.log
Here is what I have in my file more /etc/my.cnf
HTML Code:
[mysqld]
datadir=/var/lib/mysql
socket =/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# Clients (those using the mysqlclient10 compatibility package).
old_passwords = 1
[mysql.server]
user = mysql
basedir = /var/lib
[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
There is a socket =/var/lib/mysql/mysql.sock but I do not know what to put in the place because I have no mysql.sock file on my server
What should I do? Uninstall and reinstall mysql?
Thank you in advance for your help
Re: Mysql Error : Can't connect to local mysql server through socket ' var lib mysql mysql.sock' 2
Quote:
There are no files on my server mysqld.log
But you should have a my.cnf dixit
Quote:
[mysqld_safe]
err-log=/var/log/mysqld.log
tries to create
/var/lib/mysql/mysql.sock
and recover mysqld