Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I had a MySQL server on my Ubuntu dev box (I use a tutorial "how to install a lamp on ubuntu" type of article) and I decided to install mariadb.

So I uninstall mysql and install mariadb.

~$ mysql --version
mysql  Ver 15.1 Distrib 10.0.3-MariaDB, for debian-linux-gnu (i686) using readline 5.1
~$ mysqld --version
mysqld  Ver 10.0.3-MariaDB-1~precise-log for debian-linux-gnu on i686 (mariadb.org binary distribution)

The installation worked fine, all my database worked fine except I get this error when I run the code:

Warning: mysqli::mysqli() [mysqli.mysqli]: Headers and client library minor version mismatch. Headers:50529 Library:100003 in /var/www/test.php on line 5

this is my php code:

  $mysqli = new mysqli("localhost", "root", "", "test");

  if (mysqli_connect_errno()) {
      printf("Connect failed: %s\n", mysqli_connect_error());
      exit();
  }

  $query = "SELECT * FROM test";

  if ($result = $mysqli->query($query)) {

      while ($row = $result->fetch_assoc()) {
          printf ("%s (%s)\n", $row["id"], $row["name"]);
      }
      $result->free();
  }

  $mysqli->close();

and the mysql info:

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 40
Server version: 10.0.3-MariaDB-1~precise-log mariadb.org binary distribution

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> select version();
+------------------------------+
| version()                    |
+------------------------------+
| 10.0.3-MariaDB-1~precise-log |
+------------------------------+
1 row in set (0.00 sec)

MariaDB [test]> show tables;
+----------------+
| Tables_in_test |
+----------------+
| test           |
+----------------+
1 row in set (0.01 sec)

MariaDB [test]> show create table test\G
*************************** 1. row ***************************
       Table: test
Create Table: CREATE TABLE `test` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)

MariaDB [test]> select * from test;
+------+------+
| id   | name |
+------+------+
|    1 | dev  |
|    2 | qa   |
+------+------+
2 rows in set (0.01 sec)

I tried a mysql_upgrade:

mysql_upgrade --force
Phase 1/3: Fixing table and database names
Phase 2/3: Checking and upgrading tables
Processing databases
information_schema
mysql
mysql.column_stats                                 OK
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.event                                        OK
mysql.func                                         OK
mysql.gtid_slave_pos                               OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.index_stats                                  OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.table_stats                                  OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
performance_schema
test
test.test                                          OK
Phase 3/3: Running 'mysql_fix_privilege_tables'...
OK

As far as I know everything there is ok. What's the problem?

Also, is MariaDB ready for production?

share|improve this question
    
See this: How can I upgrade from MySQL to MariaDB? The problem is probably due to you had mysql 5.1 and the new installation is newer version (10.0). It may be solved if you run mysql_upgrade. –  ypercube Jun 27 '13 at 13:31
    
@ypercube no success, I update my question. It didn’t worked –  Pat R Ellery Jun 27 '13 at 13:33
    
@ypercube so you saying I should install version 5.5 instead of 10.0? –  Pat R Ellery Jun 27 '13 at 13:35
    
10.0 is afaik still in alpha stage. But the problem may not be that. MySQL 5.1 can be replaced by MariaDB version 5.1 5.2 or 5.3 without issues. MySQL 5.5 can be replaced by MariaDB 5.5, too. From mysql 5.1 to 10.0 (or to mariadb 5.5) it's a replacement and an upgrade. The problem may just be with the PHP libraries but I'm not sure how it can be resolved (still chances are better with maria 5.5 which is GA than 10.0 which is still in development.) You can also ask a question at their site, if noone asnwers here. Their developers there can give answer, for sure. –  ypercube Jun 27 '13 at 13:41
    
And check this, too: Installation issues with PHP5 –  ypercube Jun 27 '13 at 13:45
add comment

1 Answer

up vote 3 down vote accepted
+100

Answers are here in the MariaDB knowledge base: https://kb.askmonty.org/en/installation-issues-with-php5/ - basically, PHP has been compiled vs the MySQL 5.5 library and you get a version mismatch warning - this is not an error and you can still run your code normally though. There are a number of ways to solve that, the most obvious is using mysqlnd which is a native PHP extension and is not linked vs. any of the old mysqlclient libraries.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.