SDB:Switching between MySQL variants
tagline: From openSUSE
|Tested on openSUSE||Recommended articles||Related articles|
Starting from openSUSE 11.3, we've got multiple packages in distribution that can provide MySQL server and client. Sometimes, people may want to switch from one of these providers to another one. But this situation is not limited only to 11.3 and newer version of openSUSE. You can face the same situation on 11.2 and older if have server:database or server:database:UNSTABLE repositories from openSUSE Build Service enabled.
 Available Variants
Following variants of MySQL are available in openSUSE 11.3 and server:database repository.
 MySQL Community Server
If you are unsure and just want some MySQL, this is what you want. MySQL Community Server is opensource variant of MySQL server developed mainly by Oracle.
Package name: mysql-community-server
MariaDB is a branch of MySQL maintained by community in collaboration with Monty Program. It incorporates many improvements provided by community and more opensource storage engines. List of differences can be found on official site.
Package name: mariadb
 MySQL Cluster
Other opensource product from Oracle. MySQL Cluster contains as a core MySQL Community Server, but it adds clustering support.
Package name: mysql-cluster
 Unstable versions
If you are not satisfied with these three versions, you can use server:database:UNSTABLE repository, where are newest version and betas.
You can switch easilly using just the package management. Although in most cases everything should work just fine, it's alway a good idea to backup your data first. Just choose the variant you want and try to install it using package name mentioned above. Package management will take care of the rest as packages conflicts with each other. It will ask you to decide, whether do you want to uninstall your current mysql provider and install the new one, or if you want to keep it like it is.
Let's say that you have MySQL Community server and you want to try MariaDB. Workflow may look like this:
# zypper in mariadb Loading repository data... Reading installed packages... Resolving package dependencies... Problem: mysql-community-server-5.1.46-2.14.x86_64 conflicts with namespace:otherproviders(mysql) provided by mariadb-5.1.44-2.9.x86_64 Solution 1: deinstallation of mysql-community-server-5.1.46-2.14.x86_64 Solution 2: do not install mariadb-5.1.44-2.9.x86_64 Choose from above solutions by number or cancel [1/2/c] (c): 1 Resolving dependencies... Resolving package dependencies... The following NEW packages are going to be installed: libmariadbclient16 libmariadbclient_r16 mariadb mariadb-client The following packages are going to be REMOVED: mysql-community-server mysql-community-server-client 4 new packages to install, 2 to remove. Overall download size: 5.2 MiB. After the operation, 4.1 MiB will be freed. Continue? [y/n/?] (y): y Removing mysql-community-server-5.1.46-2.14 [done] Additional rpm output: Shutting down service MySQL ..done Removing mysql-community-server-client-5.1.46-2.9 [done] Retrieving package libmariadbclient_r16-5.1.44-2.9.x86_64 (1/4), 479.0 KiB (1.5 MiB unpacked) Retrieving: libmariadbclient_r16-5.1.44-2.9.x86_64.rpm [done (267.8 KiB/s)] Installing: libmariadbclient_r16-5.1.44-2.9 [done] Retrieving package libmariadbclient16-5.1.44-2.9.x86_64 (2/4), 475.0 KiB (1.5 MiB unpacked) Retrieving: libmariadbclient16-5.1.44-2.9.x86_64.rpm [done] Installing: libmariadbclient16-5.1.44-2.9 [done] Retrieving package mariadb-client-5.1.44-2.9.x86_64 (3/4), 154.0 KiB (375.0 KiB unpacked) Retrieving: mariadb-client-5.1.44-2.9.x86_64.rpm [done] Installing: mariadb-client-5.1.44-2.9 [done] Retrieving package mariadb-5.1.44-2.9.x86_64 (4/4), 4.1 MiB (21.5 MiB unpacked) Retrieving: mariadb-5.1.44-2.9.x86_64.rpm [done (5.3 MiB/s)] Installing: mariadb-5.1.44-2.9 [done]
 Possible problems
 Different plugin names
What can happen easilly is that name of the plugins have changed. So if some storage engine cannot be loaded, check whether you are trying to load correct plugin.
 Lost configuration
While switching between MySQL variants, your configuration file /etc/my.cnf might be overwritten. Usually backup copy is saved as /etc/my.cnf.rpmsave. So if your data are not available after switch, don't panic and take a look at your configuration file.
 Not supported storage engine
It might happened that your old storage engine is no longer supported by newer/different version of MySQL. So it is always a good idea to backup your data for example using mysqdump. That way, you'll have text representation of your data and you can change storage engine and reload them.