I am trying to set up a new system using Debian Squeeze. I did a "headless" install (no desktop, Apache, sql + ssh only), then installed the mysql-admin package (this because I didn't realize that the default SQL used is postgresql). Finally, I set up a database copied from another working
system.
When I boot this new system, the MySQL client fails to launch initially, then re-launches some 30 seconds later. The relevent messages from daemon.log are:
Feb 16 17:02:34 dhclient: bound to 10.31.1.93 -- renewal in 97369 seconds.
Feb 16 17:02:38 /etc/init.d/mysql[1402]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Feb 16 17:02:38 /etc/init.d/mysql[1402]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Feb 16 17:02:38 /etc/init.d/mysql[1402]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Feb 16 17:02:38 /etc/init.d/mysql[1402]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Feb 16 17:02:38 /etc/init.d/mysql[1402]:
Feb 16 17:03:14 mysqld: 120216 17:03:14 InnoDB: Started; log sequence number 0 44233
Feb 16 17:03:14 mysqld: 120216 17:03:14 [Note] Event Scheduler: Loaded 0 events
Feb 16 17:03:14 mysqld: 120216 17:03:14 [Note] /usr/sbin/mysqld: ready for connections.
Feb 16 17:03:14 mysqld: Version: '5.1.49-3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
root 1106 0.0 0.0 1748 544 ? S 17:02 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 1222 0.1 1.6 136392 16476 ? Sl 17:02 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
root 1223 0.0 0.0 1672 544 ? S 17:02 0:00 logger -t mysqld -p daemon.error
root 1505 0.0 0.0 3300 744 tty1 S+ 17:04 0:00 grep mysql
This causes a problem for an app I wrote which is launched in rc.local. It tries to connect to the MySQL database, which fails since (my assumption) the MySQL client isn't running yet. It also extends the system boot time by about 30 seconds.
If I kill mysqld then relaunch from the command line (/etc/init.d/mysql) it works fine. This problem only occurs at system startup.
Can anyone explain why this is happening? I note that mysqld.sock is located in /var/... When I formatted the disk for this system, I put /var in a separate partition. Perhaps /var hasn't mounted yet when the script tries to launch mysqladmin?
system.
When I boot this new system, the MySQL client fails to launch initially, then re-launches some 30 seconds later. The relevent messages from daemon.log are:
Feb 16 17:02:34 dhclient: bound to 10.31.1.93 -- renewal in 97369 seconds.
Feb 16 17:02:38 /etc/init.d/mysql[1402]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Feb 16 17:02:38 /etc/init.d/mysql[1402]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Feb 16 17:02:38 /etc/init.d/mysql[1402]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Feb 16 17:02:38 /etc/init.d/mysql[1402]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Feb 16 17:02:38 /etc/init.d/mysql[1402]:
Feb 16 17:03:14 mysqld: 120216 17:03:14 InnoDB: Started; log sequence number 0 44233
Feb 16 17:03:14 mysqld: 120216 17:03:14 [Note] Event Scheduler: Loaded 0 events
Feb 16 17:03:14 mysqld: 120216 17:03:14 [Note] /usr/sbin/mysqld: ready for connections.
Feb 16 17:03:14 mysqld: Version: '5.1.49-3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Debian)
root 1106 0.0 0.0 1748 544 ? S 17:02 0:00 /bin/sh /usr/bin/mysqld_safe
mysql 1222 0.1 1.6 136392 16476 ? Sl 17:02 0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
root 1223 0.0 0.0 1672 544 ? S 17:02 0:00 logger -t mysqld -p daemon.error
root 1505 0.0 0.0 3300 744 tty1 S+ 17:04 0:00 grep mysql
This causes a problem for an app I wrote which is launched in rc.local. It tries to connect to the MySQL database, which fails since (my assumption) the MySQL client isn't running yet. It also extends the system boot time by about 30 seconds.
If I kill mysqld then relaunch from the command line (/etc/init.d/mysql) it works fine. This problem only occurs at system startup.
Can anyone explain why this is happening? I note that mysqld.sock is located in /var/... When I formatted the disk for this system, I put /var in a separate partition. Perhaps /var hasn't mounted yet when the script tries to launch mysqladmin?