[MDEV-7422] Migration to MariaDB 10.0 fails Created: 2015-01-08  Updated: 2015-02-06  Resolved: 2015-02-06

Status: Closed
Project: MariaDB Server
Component/s: Platform Debian
Affects Version/s: 10.0.15
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Thomas Assignee: Otto Kekäläinen
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

Ubuntu Server 14.04


Attachments: PNG File VM 150 ('zentyal-x64') - Mozilla Firefox_051.png    

 Description   

Hello!

I'm not sure whether this is a bug or simply an error occuring in my system only.

I want to migrate to MariaDB 10.0 and follow the best practice guide from MariaDB.
In detail I executed the following steps:

  • Start Ubuntu in recovery mode
  • Stop service mysql
  • Start installation of mariadb-server

The installation will automatically remove mysql-server-5.5 and all depending packages.

However, the configuration of package mariadb-server-10.0 fails with this error:
trying to overwrite '/usr/share/mysql/mysql_system_tables.sql, which is also in package mysql-server-core-5.5
(All details in attached screenshot).

How can I fix this problem?

THX



 Comments   
Comment by Elena Stepanova [ 2015-01-08 ]

Hi,

Could you please point at the best practice guide that you are following? It should probably be updated or fixed.

Installing deb packages manually (i.e. without a package manager like apt-get or similar) is not recommended as best practice, although should be possible. But I don't think dpkg is even expected to take care of dependencies, replacements and such, is it? If you want to install the server this way, you should remove the previous installation.

Note: If you do it carefully, your datadir shouldn't be touched, but creating a backup before an upgrade of any kind is always recommended as the best practice.

Alternatively, you can use a package manager. Normally it would take care of the upgrade, although on Trusty which you are apparently using there is a problem described in MDEV-5977 which you might also encounter. If you do, you can find a workaround in the description of the bug report.

See also https://mariadb.com/kb/en/mariadb/documentation/getting-started/binary-packages/installing-mariadb-deb-files/ for some more information about possible installation issues and their resolution.

Comment by Daniel Black [ 2015-01-08 ]

looks like you need to remove mysql-server-core-5.5 too. Care not to purge anything otherwise your data may go too.

dpkg -l | egrep '(mysql|mariadb)' to see if any existing packages are pulling this in.

Once installed you may get some config errors that show up in the error log. These are fixed by replacing the erroneous directives with the modern 10 equivalents or removing them.

Comment by Thomas [ 2015-01-09 ]

I repeated the installation attempt and can now completely document the installation process with apt:
1. To verify what version of mysql-server is installed

thomas@vm4-zentyal64:~$ apt-cache policy mysql-server
mysql-server:
  Installiert:           5.5.40-0ubuntu0.14.04.1
  Installationskandidat: 5.5.40-0ubuntu0.14.04.1
  Versionstabelle:
 *** 5.5.40-0ubuntu0.14.04.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.5.35+dfsg-1ubuntu1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
thomas@vm4-zentyal64:~$ apt-cache policy mysql-server-5.5
mysql-server-5.5:
  Installiert:           5.5.40-0ubuntu0.14.04.1
  Installationskandidat: 5.5.40-0ubuntu0.14.04.1

2. To verify what version of MariaDB is available:

thomas@vm4-zentyal64:~$ apt-cache policy mariadb-server
mariadb-server:
  Installiert:           (keine)
  Installationskandidat: 10.0.15+maria-1~trusty
  Versionstabelle:
     10.0.15+maria-1~trusty 0
        500 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main amd64 

Packages

     5.5.40-0ubuntu0.14.04.1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     5.5.36-1 0
        500 http://de.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages

3. The installation process using apt:

thomas@vm4-zentyal64:~$ sudo apt-get install mariadb-server
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden zusätzlichen Pakete werden installiert:
  libmariadbclient18 libmysqlclient18 mariadb-client-10.0
  mariadb-client-core-10.0 mariadb-server-10.0 mariadb-server-core-10.0
Vorgeschlagene Pakete:
  tinyca mailx mariadb-test
Empfohlene Pakete:
  libhtml-template-perl
Die folgenden Pakete werden ENTFERNT:
  mysql-client-5.5 mysql-client-core-5.5 mysql-server mysql-server-5.5
  mysql-server-core-5.5
Die folgenden NEUEN Pakete werden installiert:
  libmariadbclient18 mariadb-client-10.0 mariadb-client-core-10.0
  mariadb-server mariadb-server-10.0 mariadb-server-core-10.0
Die folgenden Pakete werden aktualisiert (Upgrade):
  libmysqlclient18
1 aktualisiert, 6 neu installiert, 5 zu entfernen und 2 nicht aktualisiert.
Es müssen 12,6 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 36,1 MB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] 
Holen: 1 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main mariadb-server-10.0 amd64 10.0.15+maria-1~trusty [5.958 kB]
Holen: 2 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main libmysqlclient18 amd64 10.0.15+maria-1~trusty [2.886 B]
Holen: 3 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main libmariadbclient18 amd64 10.0.15+maria-1~trusty [565 kB]
Holen: 4 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main mariadb-client-core-10.0 amd64 10.0.15+maria-1~trusty [665 kB]
Holen: 5 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main mariadb-client-10.0 amd64 10.0.15+maria-1~trusty [1.014 kB]
Holen: 6 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main mariadb-server-core-10.0 amd64 10.0.15+maria-1~trusty [4.361 kB]
Holen: 7 http://mirror2.hs-esslingen.de/mariadb/repo/10.0/ubuntu/ trusty/main mariadb-server all 10.0.15+maria-1~trusty [2.924 B]
Es wurden 12,6 MB in 3 s geholt (3.279 kB/s).
Vorkonfiguration der Pakete ...
dpkg: mysql-server: Abhängigkeitsprobleme, wird aber wie gefordert dennoch entfernt:
 zentyal-core hängt ab von mysql-server; aber:
  Paket mysql-server soll entfernt werden.
 
(Lese Datenbank ... 85280 Dateien und Verzeichnisse sind derzeit installiert.)
Entfernen von mysql-server (5.5.40-0ubuntu0.14.04.1) ...
Entfernen von mysql-server-5.5 (5.5.40-0ubuntu0.14.04.1) ...
mysql stop/waiting
Trigger für man-db (2.6.7.1-1ubuntu1) werden verarbeitet ...
(Lese Datenbank ... 85202 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../mariadb-server-10.0_10.0.15+maria-1~trusty_amd64.deb ...
Entpacken von mariadb-server-10.0 (10.0.15+maria-1~trusty) ...
dpkg: Fehler beim Bearbeiten des Archivs /var/cache/apt/archives/mariadb-server-10.0_10.0.15+maria-1~trusty_amd64.deb (--unpack):
 Versuch, »/usr/share/mysql/mysql_system_tables.sql« zu überschreiben, welches auch in Paket mysql-server-core-5.5 5.5.40-0ubuntu0.14.04.1 ist
dpkg-deb: Fehler: Unterprozess einfügen wurde durch Signal (Broken pipe) getötet
Fehler traten auf beim Bearbeiten von:
 /var/cache/apt/archives/mariadb-server-10.0_10.0.15+maria-1~trusty_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Removing the package mysql-server-core-5.5 is not really an option because there are dependencies to other packages I don't want to remove. But I assume this is then potentially an issue I should address to the developers of the dependent packages.

Comment by Elena Stepanova [ 2015-01-09 ]

otto,

Any thoughts and recommendations on what (if anything) should be done on our side will be much appreciated.

Comment by Thomas [ 2015-01-09 ]

OK. I would appreciate a statement regarding the root cause.
According to my understanding, the potential root cause is either related to MariaDB replacing an existing MySQL installation or it is related to the other packages installed having reverse dependency to package mysql-server-5.5.

For the first case, I might force package mangement to overwrite file "/usr/share/mysql/mysql_system_tables.sql" belonging to package mysql-server-core-5.5 using dpkg --force overwrite <package>.deb.
However I'm not sure if I risk system failure.

For the latest, could this be verified by releasing the dependency to mysql-server-5.5? If yes, how can I do that?

Comment by Jean Weisbuch [ 2015-01-10 ]

It seems that you are using a Zentyal Ubuntu distro, which version is that?

In the past, Zentyal packages were depending on mysql-server-5.5 while it should have been depending on mysql-server metapackage, making the migration to MariaDB impossible (without forcing packages installation), i dont understand German but it seems that the error message is related.

Here is the report i did on Zentyal 3.0 almost 2 years ago : http://oldtracker.zentyal.org/ticket/6606
Its stated that it should have been fixed on Zentyal 3.1 but i never got to upgrade to it so i cant confirm it has been fixed.

Comment by Thomas [ 2015-01-10 ]

Confirm the comment of Jean... actually I have created a new ticket with Zentyal incl. the reference to Jean's old ticket:
https://tracker.zentyal.org/issues/2876

In the meantime I fixed the issue by installing the package with dpkg -i --force-overwrite
dpkg -i --force-overwrite /var/cache/apt/archives/mariadb-server-10.0_10.0.15+maria-1~trusty_amd64.deb

Finally I ran mysql_upgrade -u root -p and mysql_secure_installation without any errors.

Comment by Otto Kekäläinen [ 2015-02-06 ]

This is an issue in Zentyal dependencies or documentation. On normal Ubuntu systems 'apt-get install mariadb-server' works just fine and there is no need for complex manual dpkg -i -commands.

Generated at Thu Feb 08 07:19:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.