Description:
I am experimenting with using a tmpfs mounted on /var/run. An effect of this is that the directory /var/run/mysqld does not exist on system boot. And if /ver/run/mysqld does not exists the server will not start. These error messages are put into the system log:
Feb 14 19:21:29 pegasus mysqld_safe[2390]: started
Feb 14 19:21:30 pegasus mysqld[2393]: 050214 19:21:30 [ERROR] Can't start server : Bind on unix socket: No such file or directory
Feb 14 19:21:30 pegasus mysqld[2393]: 050214 19:21:30 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?
Feb 14 19:21:30 pegasus mysqld[2393]: 050214 19:21:30 [ERROR] Aborting
Feb 14 19:21:30 pegasus mysqld[2393]:
Feb 14 19:21:30 pegasus mysqld[2393]: 050214 19:21:30 [Note] /usr/sbin/mysqld: Shutdown complete
How to repeat:
Very easy to recreate:
1. Stop the server, if it is running.
2. rmdir /var/run/mysqld
3. Start the server. I use "/etc/init.d/mysql start"
Suggested fix:
I've put a quick fix into mysqld_safe to create /var/run/mysqld if it doesn't exist. Since I'm quite new to MySQL you'll probably have a better way.
*** /usr/bin/mysqld_safe.0 2005-02-14 19:24:29.000000000 -0800
--- /usr/bin/mysqld_safe 2005-02-14 19:40:46.000000000 -0800
***************
*** 149,154 ****
--- 149,163 ----
parse_arguments PICK-ARGS-FROM-ARGV "$@"
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-/var/run/mysqld/mysqld.sock}}
+ # Create directory the $mysql_unix_port is in.
+ unix_port_dir=`dirname $safe_mysql_unix_port`
+ if [ ! -d $unix_port_dir ]
+ then
+ mkdir $unix_port_dir
+ chmod 775 $unix_port_dir
+ chown "${user}.${user}" $unix_port_dir
+ fi
+
if test ! -x $ledir/$MYSQLD
then
echo "The file $ledir/$MYSQLD doesn't exist or is not executable"