-   Linux - Newbie (
-   -   Couldn't start mysql services on Debian Lenny (

Tueleep86 10-12-2010 01:00 AM

Couldn't start mysql services on Debian Lenny
i'm new to Debian os and currently want to install php5 apache2 and mysql 5.1. But ive got problem to start the mysql services.The error on command prompt as belows:
PHP Code:

debian:/usr/local/mysql# mysqld_safe --user=mysql
101011 22:49:39 mysqld_safe Logging to '/var/lib/mysql/debian.err'.
touchcannot touch `/var/lib/mysql/debian.err': No such file or directory
chown: cannot access 
`/var/lib/mysql/debian.err': No such file or directory
101011 22:49:39 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/bin/mysqld_safe: line 96: /var/lib/mysql/debian.err: No such file or directory
/usr/bin/mysqld_safe: line 133: /var/lib/mysql/debian.err: No such file or directory
101011 22:49:39 mysqld_safe mysqld from pid file /var/run/mysqld/ ended
/usr/bin/mysqld_safe: line 96: /var/lib/mysql/debian.err: No such file or directory
debian:/usr/local/mysql# mysql -u root
ERROR 2002 (HY000): Can'
t connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I really appreciate if anyone could help me..

prayag_pjs 10-12-2010 01:03 AM

Did you give password to root user in mysql?

If not try logging in using only



If you have given the password and remember the same do this:


mysql -u root -p
and give the root password you set for using mysql

quanta 10-12-2010 01:19 AM

Post your configuration file - /etc/my.cnf?

Tueleep86 10-12-2010 01:54 AM

dEar prayag_pjs,


mysql or mysql -u root -p
none working

debian:/usr/local/mysql# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
debian:/usr/local/mysql# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Dear quanta,

Here my my.cnf file

port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
socket = /var/run/mysqld/mysqld.sock
nice = 0

# * Basic Settings
user = mysql
pid-file = /var/run/mysqld/
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english

Guys, thank you for quick reply :)

prayag_pjs 10-12-2010 01:57 AM

Try restarting mysqld service;it seems to be stopped.

And hope you remember the password.

sem007 10-12-2010 02:01 AM

restart your mysql service try to connect mysql.


quanta 10-12-2010 02:25 AM

ls -ld /var/lib/mysql?
tail -f /var/log/mysqld.log?

All times are GMT -5. The time now is 12:15 PM.