Page 1 of 1

Minor issue upgrading to ART mySQL 4.1.21-2

Posted: Sun Nov 26, 2006 5:51 pm
by hiddenidentity
Just thought I would jot this down, might be of use to someone else.

Had a small issue upgrading my Plesk 7.5.4 CentOS3 box from ART mySQL 4.1.15 to 4.1.21-2 using yum.

Stopped mysql process.

Issuing "yum upgrade mysql" worked fine, all packages downloaded and installed as expected - warning issued about "my.cnf.rpmnew" being written, no problem there.

Looked at my.cnf vs. my.cnf.rpmnew, didnt see any issues there so left alone.

Then trying to restart mysql failed. Checking logs showed an issue trying to init the database. After then moving around my mySQL innoDB files only, I still could not restart, but got messages in the error log about issues with BDB (Berkeley DB), so a bit of googling turned up this bit of info.

http://bugs.centos.org/view.php?id=869

Adding the --skip-bdb switch and bringing in my existing innoDB data files and all was good again in the world - phew!

Failing that, my last option was to kill my full mySQL data folder and allow mySQL to recreate it automagically via the /usr/bin/mysql_install_db command then restore my database data, but I don't know if that actually would have got around the BDB problems anyway?

Just curious, has anyone else have similar issues moving to mySQL 4.1.21 on CentOS?

Posted: Sun Nov 26, 2006 8:27 pm
by scott
CentOS4 right? I added a trigger into ASL to check for that, since at the time I thought that might have been grsec related. You can either launch mysql with the -- flag, or you can add the following to /etc/my.cnf
skip-bdb

Posted: Mon Nov 27, 2006 6:03 am
by hiddenidentity
No, CentOS3 actually, that URL I posted just seemed to be related somewhat, and at the least gave me the hint about the bdb skip switch.

Thanks for the quick reply, good to know its not something that I have done wrong regardless.

How is it written in the my.cnf file? Do I just add a new line with "skip-bdb" on it? That would prob be nicer than hacking the init.d mysql script.

Posted: Mon Nov 27, 2006 9:28 am
by scott
You'll want to stick that in like this:

[mysql]
skip-bdb


Then restart mysqld and watch the logs (just in case). That should be all you have to do.

Posted: Thu Nov 30, 2006 5:49 am
by hiddenidentity
Added it to the [mysqld] section - worked a charm. My complete /etc/my.cnf now reads..


----------
[mysqld]
skip-bdb
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
----------

Posted: Thu Nov 30, 2006 10:12 am
by scott
Oh, turn on query caching too. Has nothing to do with bdb, its just going to improve your performance a lot. Add this after the socket line:

query_cache_type=1
query_cache_size = 32M

Posted: Fri Dec 01, 2006 6:57 am
by hiddenidentity
Thanks for that - well spotted, I assumed query caching was on by default.

I set a cache size of 20MB, im only running a few small sites that do smaller query sizes - I like to keep things neat and small like that :)

This page covers the topic well for others interested..

http://www.databasejournal.com/features ... hp/3110171