Tag Archives: mysql

Switching from MySQL to MariaDB

This blog started life on MySQL 4.x & continued to live on 5.0 until today. Whilst performing maintenance, all the packages came up to date apart from two, the MySQL 5.0 client & server which had been long removed.
I was about to commence with installing version 5.5 when I remembered a conversation I had a couple of weeks back about MariaDB, after a quick check to see what the switchover entailed, I decided to install to MariaDB instead.
It’s intended to act as a drop in replacement for MySQL, my instance has been for serving blogs & other fairly common 3rd party open source software so I didn’t have to do much apart from run mysql_upgrade after install.
In /var/db/mysql/server.example.com.err MariaDB logged
Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50084, now running 50312. Please use mysql_upgrade to fix this error. to highlight the fact.

mysql_upgrade output:
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases
information_schema
mydb
mydb.wp_commentmeta Needs upgrade
mydb.wp_comments OK
mydb.wp_links OK
mydb.wp_options OK
mydb.wp_postmeta OK
mydb.wp_posts OK
mydb.wp_term_relationships OK
mydb.wp_term_taxonomy OK
mydb.wp_terms OK
mydb.wp_usermeta OK
mydb.wp_users OK
mysql
mysql.columns_priv OK
mysql.db OK
mysql.func OK
mysql.help_category Needs upgrade
mysql.help_keyword Needs upgrade
mysql.help_relation OK
mysql.help_topic Needs upgrade
mysql.host OK
mysql.proc Needs upgrade
mysql.procs_priv OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name Needs upgrade
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_topic OK
mysql.proc OK
mysql.time_zone_name OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK

I decided to recreate my.cnf using the files shipped with MariaDB due to the introduction of new settings and a difference in values for existing settings.

The Propper way to fire up MySQL

grrr
been pulling my hair out as cron wasnt firing up, tracked the problem down to rc.local, the command to start mysql was preventing cron from running but everything seemed A-OK on the outside.
heres the correct lines to insert into rc.local on OpenBSD to fireup mysql without causing any knock on effects:
if [ -x /usr/local/bin/mysqld_safe ]; then
/usr/local/bin/mysqld_safe > /dev/null & echo -n 'mysql '
fi