Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
i cannot get mysql to start ive been to thier site and tried to reinstall mysql too.
they said make sure the mysql.sock file is present and it is...
heres the only log file i can find
/usr/libexec/mysqld, Version: 3.23.52-log, started with:
Tcp port: 3306 Unix socket: /var/lib/mysql/mysql.sock
Time Id Command Argument
also thisERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
can anyone help me?

Does a file exist as
/var/lib/mysql/mysql.sock ?What does your /etc/my.cnf file look like?
A sample snippet follows:
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# socket = /var/lib/mysql/mysql.sock
# set-variable = local-infile=1# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock

The mysl.cosk is probably owned by root and the mysql daemon is trying th "call" it
try chown mysql.sock mysqld -daemon

i can't find mysql.sock even reinstalling the rpm doesnt replace it can i recreate it?
heres my cnf file
[root@linuxserver root]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock[mysql.server]
user=mysql
basedir=/var/lib[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

Missing mysql.sock file
Posted By: Mark - Sep 27, 2002 5:58 am
you can use the following C code to recreate your mysql socket. I used this code on a RedHat 7.3 machine.type the following command at prompt as root
vi file.c
(paste the below stuff %%%%%%%%)
#include
#include#define SOCKETNAME "/mysql/mysql.sock"
// to compile use: gcc -o exe_name file.c -lnsl
int main(void)
{
int s, len;
struct sockaddr_un name;unlink(SOCKETNAME);
if((s=socket(AF_UNIX, SOCK_STREAM, 0)) < 0 )
{
perror("socket");
exit(1);
}memset(&name, 0, sizeof(struct sockaddr_un));
name.sun_family = AF_UNIX;
strcpy(name.sun_path, SOCKETNAME);
len = sizeof(name.sun_family) + strlen(name.sun_path);if(bind(s, (struct sockaddr *) &name, len) < 0)
{
perror("bind");
exit(1);
}return 0;
}
(end of paste stuff %%%%%%%%)
without the %%%% lines

ok got the winsock fixed now i need to
[root@linuxserver root]# cat /var/log/mysqld.log
021226 08:17:03 mysqld started
/usr/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
021226 8:17:03 Aborting021226 8:17:03 /usr/libexec/mysqld: Shutdown Complete
021226 08:17:04 mysqld ended
021226 15:10:39 mysqld started
/usr/libexec/mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2)
021226 15:10:39 Aborting021226 15:10:39 /usr/libexec/mysqld: Shutdown Complete
021226 15:10:39 mysqld ended
interesting?

ok i got it working here's my finding's and long term problems.....
First to recreate a socket mysql does it itself
by typing
service mysqld start
at the command prompt.....also check
/etc/my.cnf
for settings...here's my settings
-------
[mysqld]
datadir=/var/lib/mysql/
socket=/var/lib/mysql/mysql.sock
skip-innodb[mysql.server]
user=mysql
basedir=/var/lib[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
-------------
without the dashesverify the datadir in this file with the
actual directory which mine is
/var/lib/mysqlThe my.cnf i originally had said
/var/lib/mysql/mysql
ouch
Here's my log file for /var/log/mysqld.log
use the below command to view yourscat /var/log/mysqld.log
----------
021227 19:13:29 /usr/libexec/mysqld: Table 'mysql.host' doesn't exist
021227 19:13:29 mysqld ended021227 19:15:27 mysqld started
021227 19:15:28 /usr/libexec/mysqld: Table 'mysql.host' doesn't exist
021227 19:15:28 mysqld ended021227 19:18:29 mysqld started
/usr/libexec/mysqld: ready for connections------------
so it really exists but in fact first i had to create the socket with the first command
then i change my datadir to the correct directory and everything is ok....

![]() |
Best Linux?? Help!!
|
gentoo installation
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |