PDA

View Full Version : MySQL 4.1 upgrade in remastered Knoppix will not start



justahandle
04-18-2005, 07:41 AM
I'm remastering a Knoppix CD to include an updated MySQL server/client version 4.1.

When in the chroot'ed environment I apt-get installed the 4.1 MySQL server, and I am able to start the mysql server via '/etc/init.d/mysql start' ... but when the remastered version is either burned to CD or run from the iso on the hard drive, the mysql server will not start. There is also nothing (and I mean nothing ... they are empty files) written to any of the mysql logs or syslog.

The error message received is:

Starting MySQL database server: mysqld...failed.
Please take a look at the syslog.
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!


When I try to start via '/usr/bin/mysqld_safe' the error received is:

Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[2515]: started
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[2525]: ended


I need the updated 4.1 mysql as this is the version being used in a course.

Any ideas as to why this issue exists when running the remastered Knoppix?

Many thanks.

PAlvarez
04-19-2005, 11:44 PM
I think the problem is that the mysqld.sock file was created when you tested the program while chrooted. But while booted from the CD, the program detects the file is present and thinks that MYSQL is already running. I have tried deleting the file, but even with UNIONFS, it won't let me. I have the same problem, and although I haven't tried it yet, I think there are several ways to fix this:

1. Run Mysql and use a flag to point to a different directory for the socket file, like /tmp/mysqld.sock

or

2. Remove the mysqld.sock file in chroot and remaster the iso

or

3. Make a symlink from /var/run/mysqld/mysqld.sock to another directory, like /tmp/mysqld.sock

Let me know if that helps...

justahandle
04-20-2005, 06:54 AM
The problem was that the MySQL server attempted to start, then failed to start -- thus causing the error. The solution was a bit complicated and required remastering several times, but the basic information needed for the solution was found in these two threads. (UnderScore's information was pretty much on target for my needs ... UnderScore, if you read this - Thanks!)

http://www.knoppix.net/forum/viewtopic.php?t=17570
http://www.knoppix.net/forum/viewtopic.php?t=17509

1st) PROBLEM: After apt-get install of MySQL 4.1,the mysql server failed to start when burned to CD.
1st) SOLUTION: The upgraded to MySQL apparently changed the InnoDB configuration. While the databases contained in /var/lib/mysql were copied over to the ram disk and were readable, the new file(s) with ibdata1...3 was a symlink to the /KNOPPIX/var/lib/mysql/ibdata1 and was read only. So I went in to the minirt24 file using the instructions in the above two threads and copied the 'ibdata' file(s) over to the ram disk.

2nd) PROBLEM: Same problem different solution. Now the /var/mysql/log directory didn't exist on the read-only file system, and also wasn't copied over to the writable ram disk.
2nd) SOLUTION: Similar to the first except that instead of copying files I created the needed directory and them copied over to the ram disk.

3rd) PROBLEM: Same problem but now the solution was permissions. The /var/mysql/log directory was owned by root and MySQL couldn't write to them even when on the ramdisk.
3rd) SOLUTION: I tried several times to change the owner and group within the minirt24 file, but the mysql user hasn't been created yet, so attempts to chown/chgrp errored. So I changed the permissions to 777. A more secure solution to a world readable/writable directory would have been to just add the directory when chroot'ed. I just wasn't in the mood and didn't have the time to create an all new compressed file system, and just changing the minirt24 script I only needed to update the md5sums. :)

So, putting all this together ... the 4.1 upgrade apparently added some additional logging features and changed the InnoDB configuration which needed to be adjusted for the LiveCD environment.

InnoDB info
http://mysql.netvisao.pt/doc/mysql/en/InnoDB_configuration.html