Problem upgrade mysql when datadir is moved to other place

Bug #1623371 reported by Mayo
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mysql-5.7 (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I have moved mysql datadir to /home/mysql. In /var/lib/mysql is symlink to /home/mysql. Upgrade failed.

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: mysql-server-5.7 5.7.13-0ubuntu0.16.04.2
ProcVersionSignature: Ubuntu 4.4.0-36.55-generic 4.4.16
Uname: Linux 4.4.0-36-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
Date: Wed Sep 14 09:51:29 2016
DpkgTerminalLog:
 Preparing to unpack .../mysql-server-5.7_5.7.15-0ubuntu0.16.04.1_amd64.deb ...
 cp: nie je možné prepísať adresár '/var/lib/mysql-upgrade/DATADIR.link/mysql' súborom (ktorý nie je adresár)
 dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.15-0ubuntu0.16.04.1_amd64.deb (--unpack):
  subprocess new pre-installation script returned error exit status 1
DuplicateSignature:
 package:mysql-server-5.7:5.7.13-0ubuntu0.16.04.2
 Preparing to unpack .../mysql-server-5.7_5.7.15-0ubuntu0.16.04.1_amd64.deb ...
 cp: nie je možné prepísať adresár '/var/lib/mysql-upgrade/DATADIR.link/mysql' súborom (ktorý nie je adresár)
 dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.15-0ubuntu0.16.04.1_amd64.deb (--unpack):
  subprocess new pre-installation script returned error exit status 1
ErrorMessage: subprocess new pre-installation script returned error exit status 1
InstallationDate: Installed on 2014-12-14 (639 days ago)
InstallationMedia: Ubuntu 14.04.1 LTS "Trusty Tahr" - Release amd64 (20140722.2)
Logs.var.log.daemon.log:

MySQLConf.etc.mysql.conf.d.mysql.cnf: [mysql]
MySQLConf.etc.mysql.conf.d.mysqldump.cnf:
 [mysqldump]
 quick
 quote-names
 max_allowed_packet = 16M
MySQLConf.etc.mysql.mysql.conf.d.mysqld_safe_syslog.cnf:
 [mysqld_safe]
 syslog
MySQLVarLibDirListing: ['nn', 'c1realsoft', 'performance_schema', 'ibdata1', 'debian-5.7.flag', 'mysql_upgrade_info', 'faktury', 'debian-5.5.flag', 'ib_buffer_pool', 'topreality', 'elastic', 'xreality', 'ib_logfile1', 'auto.cnf', 'mysql', 'netteskolenie', 're2', 'ibtmp1', 'imobiliaresoft', 'debian-5.6.flag', 'sys', 'ib_logfile0']
ProcCmdline: BOOT_IMAGE=/boot/vmlinuz-4.4.0-36-generic root=UUID=800ed27d-efec-4f0d-85a3-cce518c18c30 ro quiet splash vt.handoff=7
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.12~ubuntu16.04.1
SourcePackage: mysql-5.7
Title: package mysql-server-5.7 5.7.13-0ubuntu0.16.04.2 failed to install/upgrade: subprocess new pre-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.mysql.mysql.conf.d.mysqld.cnf: [modified]
mtime.conffile..etc.mysql.mysql.conf.d.mysqld.cnf: 2016-08-25T14:36:38.667364

Revision history for this message
Mayo (marian-sova) wrote :
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mysql-5.7 (Ubuntu):
status: New → Confirmed
Revision history for this message
Tim Cagle (tcagle53) wrote :

Like original poster, I have moved datadir to a path in /home (outside of / filesystem). Action taken to resolve space constraints on the / filesystem (16GB SSD).

Changed in mysql-5.7 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

There are a number of bugs related to users changing the default data directory, that I am tagging mysql-alternate-datadir so we can search for them directly.

I believe this particular failure is exactly bug 1474212, so I'll mark this bug as a duplicate of that one. However, you may still have an issue after that particular bug is fixed, because of the other datadir changing issues. If you still hit issues after bug 1474212 is fixed in the release you're using, please go ahead and file any additional bugs tagged mysql-alternate-datadir for this use case if there isn't one that tracks a particular root cause already.

tags: added: mysql-alternate-datadir
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.