MYSQLD failing

So, I am in the process of installing courier/squirrelmail and so I installed mysql. I'm running a Debian 5.0 server.

At startup I get the message:

Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

I checked /var/log/syslog and it tells me this:

Apr 9 16:30:08 mail authdaemond: failed to connect to mysql server (server=localhost, userid=mailad

min): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Any ideas?

19 Replies

This is during the boot process. And I always sudo when attempting to restart the service.

Anything in /var/log/mysql.log or /var/log/mysql.err?

What about /var/log/syslog?

/var/log/syslog;

mail /var/log: sudo tail syslog
Apr  9 22:21:17 mail mysqld[2139]: 090409 22:21:17  InnoDB: Starting shutdown...
Apr  9 22:21:19 mail mysqld[2139]: 090409 22:21:19  InnoDB: Shutdown completed; log sequence number 0 43655
Apr  9 22:21:19 mail mysqld[2139]: 090409 22:21:19 [Note] /usr/sbin/mysqld: Shutdown complete
Apr  9 22:21:19 mail mysqld[2139]: 
Apr  9 22:21:19 mail mysqld_safe[2170]: ended
Apr  9 22:21:31 mail /etc/init.d/mysql[2300]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Apr  9 22:21:31 mail /etc/init.d/mysql[2300]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Apr  9 22:21:31 mail /etc/init.d/mysql[2300]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Apr  9 22:21:31 mail /etc/init.d/mysql[2300]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Apr  9 22:21:31 mail /etc/init.d/mysql[2300]: 

Nothing in mysql.log or mysql.err

Try running mysqld from the command line. It might have more debugging output.

Also, did you make any changes to mysql since installing? The default debian package should just run.

@btmorex:

Try running mysqld from the command line. It might have more debugging output.

I didn't know I could run it from something other than the command line when using a server…

The output is what I've posted.

@btmorex:

Also, did you make any changes to mysql since installing? The default debian package should just run.

I was tinkering with /etc/hosts

Not saying thats the last change I made(busy day) but its what I remember most recently.

> I didn't know I could run it from something other than the command line when using a server…
I suspect he meant in contrast to rebooting the server.

It sounds like you have two problems: 1) mailadmin (courier?) can't connect to mysql, and 2) mysqld isn't starting.

Which packages did you install for mysql ? Presumably, you installed both the client and server packages ?

@mjrich:

> I didn't know I could run it from something other than the command line when using a server…
I suspect he meant in contrast to rebooting the server.

It sounds like you have two problems: 1) mailadmin (courier?) can't connect to mysql, and 2) mysqld isn't starting.

Which packages did you install for mysql ? Presumably, you installed both the client and server packages ?

That's a good summary of the problems at the moment.

Here is my most recent command:

sudo aptitude install postfix postfix-mysql mysql-server postfix-tls libsasl2-2 libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl telnet mailx

1) apt-cache policy mysql-client ?

2) double check /etc/hosts…

@mjrich:

1) apt-cache policy mysql-client ?

2) double check /etc/hosts…

mysql-client:
  Installed: 5.0.51a-24
  Candidate: 5.0.51a-24
  Version table:
 *** 5.0.51a-24 0
        500 http://mirror.cc.columbia.edu lenny/main Packages
        100 /var/lib/dpkg/status

/etc/hosts:

127.0.0.1 localhost.localdomain         localhost
192.168.0.100 mail.mydomain.com

> Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
Do you still get this when (re)starting via sudo /etc/init.d/mysql restart, while tailing /var/log/syslog ?

If there is a chance you might have modified any of the mysql config files, it might be worth reinstalling mysql-client and mysql-server with –purge.

@mjrich:

> Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
Do you still get this when (re)starting via sudo /etc/init.d/mysql restart, while tailing /var/log/syslog ?

If there is a chance you might have modified any of the mysql config files, it might be worth reinstalling mysql-client and mysql-server with –purge.

Funny enough…when I try to --purge remove mysql-server/client it reinstalls mysql and prompts me for a password…

> Funny enough…when I try to --purge remove mysql-server/client it reinstalls mysql and prompts me for a password
This shouldn't happen with a straight apt-get remove –purge mysql-client mysql-server, however presumably you also issued some command to reinstall those packages.

Regardless, it sounds like everything should be working now (assuming you have a mailadmin user with appropriate grants for mysql).

@mjrich:

> Funny enough…when I try to --purge remove mysql-server/client it reinstalls mysql and prompts me for a password
This shouldn't happen with a straight apt-get remove –purge mysql-client mysql-server, however presumably you also issued some command to reinstall those packages.

Regardless, it sounds like everything should be working now (assuming you have a mailadmin user with appropriate grants for mysql).

That's what I thought too but here's my output(there is a prompt to enter my password thrown in there):

mail ~: sudo apt-get remove --purge  mysql-server mysql-client
[sudo] password for jeff: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package mysql-server is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libnet-daemon-perl libhtml-template-perl libdbi-perl libdbd-mysql-perl
  mysql-server-5.0 libterm-readkey-perl mysql-client-5.0 libplrpc-perl
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  mysql-client*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 81.9kB disk space will be freed.
Do you want to continue [Y/n]? y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 24442 files and directories currently installed.)
Removing mysql-client ...
Setting up mysql-server-5.0 (5.0.51a-24) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Stopping MySQL database server: mysqld.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LANG = "en_CA.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)
mail ~: 

@nsajeff:

@btmorex:

Try running mysqld from the command line. It might have more debugging output.

I didn't know I could run it from something other than the command line when using a server…

The output is what I've posted.

I meant starting it without using the init script so that you get the full debugging output on your terminal instead of redirected to log file or /dev/null (whatever the case may be).

````
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

Looks like mysql-server isn't fully installed yet. You could try letting apt fix it, e.g. __apt-get -f install__ (with no packages), or alternatively configure locales for your server (the probable cause of installation of mysql-server failing):

locale -a (show current installed locales)
dpkg-reconfigure locales
````

@mjrich:

dpkg: error processing mysql-server-5.0 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)

Looks like mysql-server isn't fully installed yet. You could try letting apt fix it, e.g. apt-get -f install (with no packages), or alternatively configure locales for your server (the probable cause of installation of mysql-server failing):

locale -a  (show current installed locales)
dpkg-reconfigure locales

Thanks for all the help but I caved and just reinstalled the system after a quick data backup. Was not worth the hassle.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct