Can MySQL seamlessly be replaced with MariaDB or are there things to change in this case?

StackOverflow https://stackoverflow.com/questions/4106315

  •  29-09-2019
  •  | 
  •  

문제

If I replace a MySQL 5.1 server with a MariaDB Server (Maria & XtraDB storages) instead of MySQL (MyISAM & InnoDB), will most of MySQL client software (incl. applications made with PHP 5.2 and Java SE 1.6) ...

  1. just remain working without any changes (with minor regressions maybe)?
  2. Or will I have to replace/reconfigure client drivers (like use another JDBC driver class and connection string)?
  3. Or will I have even to change application code?
도움이 되었습니까?

해결책

http://kb.askmonty.org/v/mariadb-versus-mysql

All MySQL connectors (PHP, Perl, Python, Java, MyODBC, Ruby, MySQL C connector etc) works unchanged with MariaDB.

다른 팁

I have used Mariadb as replacement for Oracle's MySQL for years. It is faster and very reliable. Needs just little attention in apt, but nothing severe. Also, there is one small detail with Mariadb; it is seeing [error] "PHP Warning: mysql_connect(): Headers and client library minor version mismatch" in the logs. I haven't found any other solution to that other than to start manually compiling: askMonty.

$php -i | grep 'Client API'

Client API version => 5.3.7-MariaDB
Client API library version => 5.3.7-MariaDB
Client API header version => 5.1.61
Client API version => 5.3.7-MariaDB

just remain working without any changes (with minor regressions maybe)?

You shouldn't have any issues as long as you replace with the same version. If you're currently are using MySQL 5.1, you can replace with MariaDB 5.1. If you are using 5.5, use the corresponding one. MariaDB v5.2 and v5.3 and enhanced versions of 5.1.

Or will I have to replace/reconfigure client drivers (like use another JDBC driver class and connection string)?

You shouldn't. MySQL and MariaDB both use the same protocol and overall syntax, but there could be a few exceptions in some cases. The URL quoted in another answer is a great resource: http://kb.askmonty.org/v/mariadb-versus-mysql

Regarding the drivers' licenses, there are differences if you plan to distribute your project commercially. In that case I recommend you to double check the license terms and if you have any concerns, use the MariaDB/SkySQL versions of the connectors as suggested in another answer. Check http://www.skysql.com/downloads/java-cc-connectors-mariadb for details.

Or will I have even to change application code?

The application code should be unchanged.

Just a little feedback requarding the compatibility with mysql driver/CodeIgniter. I ran into the problems on BIT attributes types few minutes ago.

Value was not retrived from the server. It was always empty. I was using standard CI database configuration which is using "mysql" driver. After changing driver in the database.php to "mysqli" problem was solved.

Just the heads up that there can be some differences if you are using old mysql driver.

$db['default']['dbdriver'] = 'mysqli';

MariaDB client API version 5.5.40

MariaDB is MySQL evolved.

It is also the same developer who is behind MySQL and MariaDB. It is almost the same (if it is not, i can only say MariaDB is MySQL improved, dot).

You don't have to change nothing in your PHP.

Contrary to popular belief, the default Connector/J JDBC driver for connecting to and interacting with MySQL in Java does not play nicely with MariaDB. To work with MariaDB, you need to have your application use the Drizzle or SkySQL driver.

http://kb.askmonty.org/en/mariadb-faq-is-there-any-java-connector-for-mariadb-than-the-one-from-mysql

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top