MYSQL Will NOT start....

Discussion in 'Server Operation' started by Richard, Apr 16, 2006.

  1. Richard

    Richard New Member

    I see that I am not the only newbee that has had problems with MQSQL but please help. I have included the syslog at the bottom but this means little to me, perhaps some of you understand what it is trying to tell me? Under that again is what I get if I run an apt-get upgrade?

    MySql will not start and I get the error 'ERROR 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' when I do a mysql -p 'password'

    I am running Debian Sarge with PHP4 and MySql. The system has been stable and I have installed a few applications the are using PHP4 and MySql, however yesterday I did something stupid and do not know how to fix it!

    I was trying to get the mail server running with no luck at all and I read in one chat room that by doing an apt-get remove postfix postfix-tls libsas12 sas12-bin lisas12-modules ipod-ssl uw-imapd-sssl and then re-installing them that the mail server would work. It does NOT! And now MySQL is not working either.

    I have run;
    locate mysqld.sock
    locate mysql.sock
    And neither return a result so I guess that MySql is not actually running.

    How do I start MySqld.sock ? I have seen lots of posts that say start this, and start that, but with no explanation of how too. Please Please help as I am desperate to get MySql working again.

    Hope there is help out there for me.

    Best regards

    Richard.

    /var/log/syslog
    Apr 16 06:28:28 server1 syslogd 1.4.1#17: restart.
    Apr 16 06:28:28 server1 postfix/pickup[1433]: E4A4C1CC1AB: uid=0 from=<root>
    Apr 16 06:28:29 server1 postfix/cleanup[1616]: E4A4C1CC1AB: message-id=<[email protected]>
    Apr 16 06:28:29 server1 postfix/qmgr[1050]: E4A4C1CC1AB: from=<root@[email protected]>, size=903, nrcpt=1 (queue active)
    Apr 16 06:28:31 server1 postfix/smtp[1618]: E4A4C1CC1AB: to=<root@[email protected]>, orig_to=<root>, relay=mail1.123utpeking.no[212.247.$
    Apr 16 06:28:31 server1 postfix/cleanup[1616]: A76BB1CC1A6: message-id=<[email protected]>
    Apr 16 06:28:31 server1 postfix/qmgr[1050]: A76BB1CC1A6: from=<>, size=3085, nrcpt=1 (queue active)
    Apr 16 06:28:31 server1 postfix/qmgr[1050]: E4A4C1CC1AB: removed
    Apr 16 06:28:32 server1 postfix/smtp[1618]: A76BB1CC1A6: to=<root@[email protected]>, relay=mail1.123utpeking.no[212.247.101.19], delay=1$
    Apr 16 06:28:32 server1 postfix/qmgr[1050]: A76BB1CC1A6: removed
    Apr 16 06:39:01 server1 /USR/SBIN/CRON[1622]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 06:47:01 server1 /USR/SBIN/CRON[1632]: (root) CMD (test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly)
    Apr 16 06:47:04 server1 syslogd 1.4.1#17: restart.
    Apr 16 07:04:33 server1 -- MARK --
    Apr 16 07:09:01 server1 /USR/SBIN/CRON[1851]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 07:17:01 server1 /USR/SBIN/CRON[1861]: (root) CMD ( run-parts --report /etc/cron.hourly)
    Apr 16 07:39:01 server1 /USR/SBIN/CRON[1863]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 08:04:33 server1 -- MARK --
    Apr 16 08:09:01 server1 /USR/SBIN/CRON[1874]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 08:17:01 server1 /USR/SBIN/CRON[1884]: (root) CMD ( run-parts --report /etc/cron.hourly)
    Apr 16 08:39:02 server1 /USR/SBIN/CRON[1886]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 09:00:01 server1 /USR/SBIN/CRON[1896]: (root) CMD (/usr/sbin/rdate 128.2.136.71 | logger -t NTP)
    Apr 16 09:00:01 server1 postfix/pickup[1872]: C79E91CC1AB: uid=0 from=<root>
    Apr 16 09:00:01 server1 postfix/cleanup[1901]: C79E91CC1AB: message-id=<[email protected]>
    Apr 16 09:00:01 server1 postfix/qmgr[1050]: C79E91CC1AB: from=<root@[email protected]>, size=536, nrcpt=1 (queue active)
    Apr 16 09:00:02 server1 postfix/smtp[1903]: C79E91CC1AB: to=<root@[email protected]>, orig_to=<root>, relay=mail1.123utpeking.no[212.247.$
    Apr 16 09:00:02 server1 postfix/cleanup[1901]: 612491CC1C0: message-id=<[email protected]>
    Apr 16 09:00:02 server1 postfix/qmgr[1050]: 612491CC1C0: from=<>, size=2718, nrcpt=1 (queue active)
    Apr 16 09:00:02 server1 postfix/qmgr[1050]: C79E91CC1AB: removed
    Apr 16 09:00:02 server1 postfix/smtp[1903]: 612491CC1C0: to=<root@[email protected]>, relay=mail1.123utpeking.no[212.247.101.19], delay=0$
    Apr 16 09:00:02 server1 postfix/qmgr[1050]: 612491CC1C0: removed
    Apr 16 09:09:01 server1 /USR/SBIN/CRON[1906]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 09:17:01 server1 /USR/SBIN/CRON[1916]: (root) CMD ( run-parts --report /etc/cron.hourly)
    Apr 16 09:39:01 server1 /USR/SBIN/CRON[1918]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 10:04:33 server1 -- MARK --
    Apr 16 10:09:01 server1 /USR/SBIN/CRON[1929]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 10:17:02 server1 /USR/SBIN/CRON[1939]: (root) CMD ( run-parts --report /etc/cron.hourly)
    Apr 16 10:39:01 server1 /USR/SBIN/CRON[1941]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 11:04:33 server1 -- MARK --
    Apr 16 11:09:01 server1 /USR/SBIN/CRON[1951]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 11:17:01 server1 /USR/SBIN/CRON[1961]: (root) CMD ( run-parts --report /etc/cron.hourly)
    Apr 16 11:39:01 server1 /USR/SBIN/CRON[1975]: (root) CMD ( [ -d /var/lib/php4 ] && find /var/lib/php4/ -type f -cmin +$(/usr/lib/php4/maxli$
    Apr 16 11:52:15 server1 postfix/postfix-script: stopping the Postfix mail system
    Apr 16 11:52:15 server1 postfix/master[1043]: terminating on signal 15
    Apr 16 11:52:16 server1 postfix/postfix-script: starting the Postfix mail system
    Apr 16 11:52:16 server1 postfix/master[2103]: daemon started -- version 2.1.5
    Apr 16 12:04:33 server1 -- MARK --

    apt-get upgrade
    server1:/usr/lib# apt-get upgrade
    Reading Package Lists... Done
    Building Dependency Tree... Done
    The following packages have been kept back:
    kernel-image-2.4-686
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    3 not fully installed or removed.
    Need to get 0B of archives.
    After unpacking 0B of additional disk space will be used.
    Do you want to continue? [Y/n] y
    Setting up ipopd (2002edebian1-11sarge1) ...
    WARNING: Port "pop2" unselected in debconf but possibly handled locally.
    Creating generic self-signed certificate: /etc/ssl/certs/ipop3d.pem
    (replace with hand-crafted or authorized one if needed).
    hostname: Unknown host
    dpkg: error processing ipopd (--configure):
    subprocess post-installation script returned error exit status 1
    Setting up uw-imapd (2002edebian1-11sarge1) ...
    WARNING: Port "imap3" unselected in debconf but possibly handled locally.
    Creating generic self-signed certificate: /etc/ssl/certs/imapd.pem
    (replace with hand-crafted or authorized one if needed).
    hostname: Unknown host
    dpkg: error processing uw-imapd (--configure):
    subprocess post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of uw-imapd-ssl:
    uw-imapd-ssl depends on uw-imapd (>= 4:2002.rc7debian); however:
    Package uw-imapd is not configured yet.
    dpkg: error processing uw-imapd-ssl (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    ipopd
    uw-imapd
    uw-imapd-ssl
    E: Sub-process /usr/bin/dpkg returned an error code (1)
     
    Last edited: Apr 16, 2006
  2. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    /etc/init.d/mysql restart
    and
    Code:
    ls -l /var/run/mysqld/mysqld.sock
    and
    Code:
    netstat -tap
    and
    Code:
    ps aux | grep -i mysql
    (in that order)?
     
  3. Richard

    Richard New Member

    MySql Problems.....

    Hi,

    I have cut a pasted exactly what I did and the results that I got directly from Putty.

    Thanks for replying I only hope that you can help...

    Last login: Sun Apr 16 14:17:16 2006 from p54836b51.dip.t-dialin.net
    server1:~# /etc/init.d/mysql restart
    server1:~# ls -l /var/run/mysqld/mysqld.sock
    ls: /var/run/mysqld/mysqld.sock: No such file or directory
    server1:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State
    PID/Program name
    tcp 0 0 *:imaps *:* LISTEN 9
    45/inetd
    tcp 0 0 *:pop3s *:* LISTEN 9
    45/inetd
    tcp 0 0 *:pop3 *:* LISTEN 9
    45/inetd
    tcp 0 0 *:imap2 *:* LISTEN 9
    45/inetd
    tcp 0 0 *:www *:* LISTEN 1
    083/apache2
    tcp 0 0 *:ssh *:* LISTEN 1
    063/sshd
    tcp 0 0 *:smtp *:* LISTEN 1
    042/master
    tcp 0 0 *:https *:* LISTEN 1
    083/apache2
    tcp 0 0 debianbox.com:ssh p54836B51.dip.t-di:1202 ESTABLISHED1
    142/sshd: root@not
    tcp 0 148 debianbox.com:ssh 192.168.1.33:2843 ESTABLISHED1
    150/1
    tcp 0 0 debianbox.com:ssh p54836B51.dip.t-di:1196 ESTABLISHED1
    126/0
    server1:~# /etc/init.d/mysql restart
    server1:~# ls -l /var/run/mysqld/mysqld.sock
    ls: /var/run/mysqld/mysqld.sock: No such file or directory
    server1:~# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:imaps *:* LISTEN 945/inetd
    tcp 0 0 *:pop3s *:* LISTEN 945/inetd
    tcp 0 0 *:pop3 *:* LISTEN 945/inetd
    tcp 0 0 *:imap2 *:* LISTEN 945/inetd
    tcp 0 0 *:www *:* LISTEN 1083/apache2
    tcp 0 0 *:ssh *:* LISTEN 1063/sshd
    tcp 0 0 *:smtp *:* LISTEN 1042/master
    tcp 0 0 *:https *:* LISTEN 1083/apache2
    tcp 0 0 debianbox.com:ssh p54836B51.dip.t-di:1202 ESTABLISHED1142/sshd: root@not
    tcp 0 148 debianbox.com:ssh 192.168.1.33:2843 ESTABLISHED1150/1
    tcp 0 0 debianbox.com:ssh p54836B51.dip.t-di:1196 ESTABLISHED1126/0
    server1:~# ps aux | grep -i mysql
    server1:~#
     
  4. Richard

    Richard New Member

    MySql Problems

    Hi Again,

    I hope that I'm not just throwing too much bad infomation at you as I know that you are trying to help. I just read a tip in another forum and they suggested this;

    server1:/var/run# mysqladmin -h host_name variables
    mysqladmin: connect to server at 'host_name' failed
    error: 'Unknown MySQL Server Host 'host_name' (1)'
    Check that mysqld is running on host_name and that the port is 3306.
    You can check this by doing 'telnet host_name 3306'

    So I tried to do the telenet........

    server1:/var/run# telnet localhost 3306
    Trying 127.0.0.1...
    telnet: Unable to connect to remote host: Connection refused
    server1:/var/run#

    It didn't help but I thought the error messages might help you help me?

    Richard
     
  5. falko

    falko Super Moderator ISPConfig Developer

    Can you post the output of
    Code:
    updatedb
    locate mysqld.sock
    locate mysql.sock
    ?
     
  6. Richard

    Richard New Member

    MySql Problems

    Hi Falko,

    Thanks for taking the time to help me with this....
    I need shooting.....

    The outputs that you asked for were;

    server1:~# updatedb
    server1:~# locate mysqld.sock
    server1:~# locate mysql.sock
    server1:~#

    This I guess is NOT good news!

    Richard
     
  7. Richard

    Richard New Member

    MySql Problems.....

    After an afternoon of trying all the MySql Forums and trying anything and everything I tried these commands again that you asked me about earlier….

    /etc/init.d/mysql restart

    ls -l /var/run/mysqld/mysqld.sock

    netstat -tap

    ps aux | grep -i mysql

    The output of these commands is now;

    server1:/etc/init.d# /etc/init.d/mysql restart
    server1:/etc/init.d# ls -l /var/run/mysqld/mysqld.sock
    ls: /var/run/mysqld/mysqld.sock: No such file or directory
    server1:/etc/init.d# netstat -tap
    Active Internet connections (servers and established)
    Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    tcp 0 0 *:imaps *:* LISTEN 1797/couriertcpd
    tcp 0 0 *:pop3s *:* LISTEN 1712/couriertcpd
    tcp 0 0 *:pop3 *:* LISTEN 1655/couriertcpd
    tcp 0 0 *:imap2 *:* LISTEN 1748/couriertcpd
    tcp 0 0 *:www *:* LISTEN 1083/apache2
    tcp 0 0 *:ssh *:* LISTEN 1063/sshd
    tcp 0 0 *:smtp *:* LISTEN 1904/master
    tcp 0 0 *:https *:* LISTEN 1083/apache2
    tcp 0 0 debianbox.com:ssh 192.168.1.33:3237 ESTABLISHED1962/sshd: root@not
    tcp 0 148 debianbox.com:ssh 192.168.1.33:3096 ESTABLISHED1283/0
    server1:/etc/init.d# ps aux | grep -i mysql
    root 1982 0.0 0.3 2256 984 pts/0 T 16:18 0:00 nano /usr/include/mysql/mysql_embed.h
    root 2249 0.0 0.4 2256 1036 pts/0 T 19:25 0:00 nano mysqld_error.h
    root 2259 0.0 0.3 2256 1012 pts/0 T 19:32 0:00 nano mysql.log
    root 2260 0.0 0.3 2256 1012 pts/0 T 19:32 0:00 nano mysql.err
    root 2292 0.0 0.3 2256 1020 pts/0 T 19:39 0:00 nano mysql
    root 2301 0.0 0.2 1824 584 pts/0 S+ 19:42 0:00 grep -i mysql

    Please help!

    Richard
     
    Last edited: Apr 16, 2006
  8. Richard

    Richard New Member

    Would this work?

    Hi Falko,

    What do you think would happen if;

    I made a copy of the files in /etc/lib/mysql/mysql
    Then did a full re-install of MySql -
    then replaced the files in /etc/lib/mysql/mysql with the copy that I took?

    Do you think that all the data would be preserved or is that too simple?

    Richard
     
  9. Richard

    Richard New Member

    Problem solved

    Ok so I messed up and this problem was all my own fault.

    The solution that finally worked was;

    A re-install of mysql-server (Nothing else)

    All databases and tables were preserved.

    Thanks for the help

    Richard
     

Share This Page