DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do _not_ recompile from source. On Debian you always want to use the APT package if one is available... APT resolves dependencies and allows for clean upgrades. You don't want to have to deal with incompatibilities down the line.
Creating mysqld.sock would not help; it is a socket, not an ordinary file - you have to create it with mknod I believe, but you don't want to go there anyway. It is created by mysqld, it is not why mysqld won't start.
Let's take a hint from the error message. Do a "/etc/init.d/mysql start" as root, then immediately do a "tail /var/log/syslog" (as root) and post the output. This should shed some light on the matter.
also the msqld.sock file in /var/run/ is created by mysql and that could be a problem who owns that directory? it should be:
drwxr-xr-x 2 mysql root 4096 Jun 8 16:05 mysqld
If mysql does not own the directory then it will not be able to create the sock file. I'm guessing here and I really don't know why apt would have it set up anyother way unless you have been messing around with users and groups.
First and foremost i would like to thank u all for your interest .....
Now lets move on to the answers
taksideytis:~# ls -l /var/lib/mysql
total 20556
-rw-rw---- 1 mysql mysql 25088 2005-06-09 18:16 ib_arch_log_0000000000
-rw-rw---- 1 mysql mysql 10485760 2005-06-10 09:39 ibdata1
-rw-rw---- 1 mysql mysql 5242880 2005-06-10 09:39 ib_logfile0
-rw-rw---- 1 mysql mysql 5242880 2005-06-09 18:16 ib_logfile1
drwxr-xr-x 2 mysql mysql 4096 2005-06-09 18:16 mysql
drwxr-xr-x 2 mysql mysql 4096 2005-06-09 18:16 test
taksideytis:~# ls -ld /var/lib/mysql
drwxrwxrwx 4 mysql mysql 4096 2005-06-10 09:39 /var/lib/mysql
taksideytis:~# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
taksideytis:~# tail /var/log/syslog
Jun 11 09:31:08 taksideytis mysqld[8207]: 050611 9:31:08 InnoDB: Starting shutdown...
Jun 11 09:31:10 taksideytis mysqld[8207]: 050611 9:31:10 InnoDB: Shutdown completed
Jun 11 09:31:10 taksideytis mysqld[8207]: 050611 9:31:10 /usr/sbin/mysqld: Shutdown Complete
Jun 11 09:31:10 taksideytis mysqld[8207]:
Jun 11 09:31:10 taksideytis mysqld_safe[8225]: ended
Jun 11 09:31:16 taksideytis /etc/init.d/mysql[8280]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jun 11 09:31:16 taksideytis /etc/init.d/mysql[8280]: ^G/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jun 11 09:31:16 taksideytis /etc/init.d/mysql[8280]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jun 11 09:31:16 taksideytis /etc/init.d/mysql[8280]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jun 11 09:31:16 taksideytis /etc/init.d/mysql[8280]:
okey... i have found sth really important in the /usr/share/doc/mysql
* MYSQL WON'T START OR STOP?:
=============================
You may never ever delete the special mysql user "debian-sys-maint". This user
together with the credentials in /etc/mysql/debian.cnf are used by the
init scripts to stop the server as they would require knowledge of the
mysql root users password else.
So in most of the times you can fix the situation by making sure that
the debian.cnf file contains the right password, e.g. by setting a new
one (remember to do a "flush privileges" then).
This specifice debian user does not exist in my system ( i dont know why) how i must add it to the /etc/passwd?
Help me with this thing... and afterwards everything will go fine
Thx a lot
yioupiii
p.s. for somereason, ps xa | grep mysqld shows 3994 pts/1 R+ 0:00 grep mysqld on my computer, even though I don't have mysql installed yet (I do have postgresql though) :$
I don't know whether you have fixed this yet or not, but I had the same error message as you when I installed mysql last night. After looking through apt-cache search mysql I noticed this package: mysql-server-4.1 which I hadn't installed yet, even though I installed all of the other things like mysql-admin and mysql-common etc. Maybe you also need to install this package to get mysql to work?
Sorry for the delayed reply... I've had a lot of work.
You do not need to (and certainly should not) install both mysql-server and mysql-server-4.1 (they are different versions; I use the former).
At this point I would say it's time to do a fresh MySQL install, especially since it sounds like a number of files have been modified after installation. I presume that you do not have any databases that need to be saved (since you can't even connect to your server). So, try the following:
1) Become root.
2) To remove all MySQL packates run:
dpkg -l | fgrep mysql | apt-get remove `awk '{print $2}'`
You may have to manually remove packages with truncated names before this batch removal will work.
3) To purge configuration files for all previously removed packages, run:
dpkg -l | egrep ^rc | dpkg -P `awk '{print $2}'`
The same qualification as in (2) applies here. Note that "fgrep" and "egrep" are different.
4) Install the minimal set of packages:
apt-get install mysql-client mysql-server mysql-common
This will also install any unmet dependencies.
Report on the results after you do this; let's see if your problems persist.
Okay, that makes sense. But as I said I run Debian Sarge with the 4.0 branch of the mysql packages, and have not encountered the problems described. So I am a bit puzzled as to why things are breaking... I really would like to hear what happens when a reinstall is attempted, if for no other reason than to prove that the problem does not lie with post-install modifications (hence the configuration purge step).
Originally posted by shultzc Okay, that makes sense. But as I said I run Debian Sarge with the 4.0 branch of the mysql packages, and have not encountered the problems described. So I am a bit puzzled as to why things are breaking... I really would like to hear what happens when a reinstall is attempted, if for no other reason than to prove that the problem does not lie with post-install modifications (hence the configuration purge step).
I'm having the exact same problem.
I removed the msyql packages and purged them as you suggest and then apt-get installed mysql afterwards and the exact same thing happend right as it finished installing.
Code:
# /etc/init.d/mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
I pretty baffled why this is happening?
I'm starting to think its a permissions error somewhere but :
Code:
# ls -al /var/run/mysqld
total 8
drwxr-xr-x 2 mysql root 4096 2005-06-16 14:46 .
drwxr-xr-x 9 root root 4096 2005-06-16 14:39 ..
mySQL is running **fine** for me (I say **fine** because I haven't really used it much yet). This is the out put i get from dpkg -l | fgrep mysql
ii libdbd-mysql-p 2.9006-1 A Perl5 database interface to the MySQL data
ii libmysqlclient 4.0.24-10 mysql database client library
ii libmysqlclient 4.1.11a-4 mysql database client library
ii mysql-client-4 4.1.11a-4 mysql database client binaries
ii mysql-common-4 4.1.11a-4 mysql database common files (e.g. /etc/mysql
ii mysql-server-4 4.1.11a-4 mysql database server binaries
ii php4-mysql 4.3.10-15 MySQL module for php4
I believe the ones you need are mysql-client mysql-common and mysql-server (and php4-mysql if you need php support for mysql). Make sure these are installed, because I got the message about the lock file because I had not installed mysql-server.
Also, the debian-sys-maint is a user in the mysql table mysql.user DON'T run mysql_install_db script, otherwise this account will be wiped! (I did this because I screwed up my root password and was locked out).
Also shultzc, do you know why I have libmysqlclient 4.0.24-10 listed twice?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.