Description:
On same environment but complete independent instances:
080625 14:22:01 [Note] ./libexec/mysqld: ready for connections.
Version: '5.0.66-debug' socket: '/tmp/mysql50bzr.sock' port: 6850 Source distribution
080625 14:21:31 [Note] ./libexec/mysqld: ready for connections.
Version: '5.0.66' socket: '/tmp/mysql50bzr.sock' port: 6858 Source distribution
As you can see, two deamons are started using the same socket but different ports.
$ ps ax | grep mysql
12607 pts/5 Sl 0:00 ./libexec/mysqld --defaults-file=/home/miracee/mysql50test/etc/my.cnf
12633 pts/4 Sl 0:00 ./libexec/mysqld --defaults-file=/home/miracee/mysql50bzr/etc/my.cnf
I know, my error here was, that I copied my.cnf from one system to the other and then changed port on the second but I forgot to change socket there.
You can also work on these two systems and all will get stored at the right data dir but it will get confusion when you make at one instance directory:
$ ./bin/mysqladmin shutdown
Then it will shutdown the wrong instance.
I remember that there was an error message at the past, when you tried to start a second deamon with same socket.
Where is it gone?
Why is it possible to start a second daemon without getting an error message or a note that socket already is in use?
How to repeat:
Get fresh mysql 5.0 bzr tree.
Make two directories:
$ mkdir mysql-5.0-src1
$ mkdir mysql-5.0-src2
copy mysql source into these two directories.
$ cp BZR_TREE mysql-5.0-src1/
$ cp BZR_TREE mysql-5.0-src2/
$ cd mysql-5.0-src1
$ ./BUILD/compile-amd64-debug-max --prefix=/home/yourhome/mysql-test-1 -c
$ make
$ make install
$ cd ../mysql-5.0-src2
$ ./BUILD/compile-amd64-debug-max --prefix=/home/yourhome/mysql-test-2 -c
$ make
$ make install
$ cd /home/yourhome/mysql-test-1
$ ./bin/mysql_install_db
$ mkdir etc
$ cd etc
$ vi my.cnf
Here is the my.cnf
[mysqld]
port = 6850
socket = /tmp/mysql50bzr.sock
[client]
port = 6850
socket = /tmp/mysql50bzr.sock
$ cd /home/yourhome/mysql-test-2
$ ./bin/mysql_install_db
$ mkdir etc
$ cd etc
$ vi my.cnf
Here is the my.cnf
[mysqld]
port = 6858
socket = /tmp/mysql50bzr.sock
[client]
port = 6858
socket = /tmp/mysql50bzr.sock
$ cd /home/yourhome/mysql-test-1
$ ./libexec/mysqld --defaults-file=/home/yourhome/mysql-test-1/etc/my.cnf &
080625 14:22:01 [Note] ./libexec/mysqld: ready for connections.
Version: '5.0.66-debug' socket: '/tmp/mysql50bzr.sock' port: 6850 Source distribution
Best to use another shell now:
$ cd /home/yourhome/mysql-test-2
$ ./libexec/mysqld --defaults-file=/home/yourhome/mysql-test-2/etc/my.cnf &
80625 14:21:31 [Note] ./libexec/mysqld: ready for connections.
Version: '5.0.66' socket: '/tmp/mysql50bzr.sock' port: 6858 Source distribution
$ ps ax | grep mysql
you will see two processes
$ cd /home/yourhome/mysql-test-2
$ ./bin/mysqladmin shutdown
$ ps ax | grep mysql
here it seems randomly which daemon will stay and which was shutted down.
Sometimes the right daemon got the shutdown.
But also often the other daemon got it.
If you have luck and the right daemon got the shutdown just start it again and try to shutdown the other.
Suggested fix:
Check if socket is already in use and if it is then just give out an error message and don't start the daemon a second time on same socket.