Unable to Move MySQL DB Location - Ubuntu 18.04.3 (LTS) x64

September 11, 2019 107 views
Storage MySQL Databases Block Storage

I followed the steps below exactly and the MySQL service will not start. This is a new Droplet with NO pre-existing data.

Reference:: https://www.digitalocean.com/community/tutorials/how-to-move-a-mysql-data-directory-to-a-new-location-on-ubuntu-18-04

Here are the apps I installed which include MySQL:: apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-xml php-mbstring php-apcu php-intl imagemagick inkscape php-gd php-cli php-curl git php-bz2

Errors from JOURNALCTL -XE::
– Unit mysql.service has begun starting up.
Sep 11 16:26:09 ark03 audit[2197]: AVC apparmor=“DENIED” operation=“open” profile=“/usr/sbin/mysqld” name=“/sys/devices/system/node/” pid=2197 comm=“mysqld” requestedmask=“r” deniedmask=“r” fsuid=0 ouid=0
Sep 11 16:26:09 ark03 kernel: audit: type=1400 audit(1568219169.013:320): apparmor=“DENIED” operation=“open” profile=“/usr/sbin/mysqld” name=“/sys/devices/system/node/” pid=2197 comm=“mysqld” requestedmask=
Sep 11 16:26:09 ark03 audit[2202]: AVC apparmor=“DENIED” operation=“open” profile=“/usr/sbin/mysqld” name=“/sys/devices/system/node/” pid=2202 comm=“mysqld” requested
mask=“r” deniedmask=“r” fsuid=111 ouid=
Sep 11 16:26:09 ark03 kernel: audit: type=1400 audit(1568219169.053:321): apparmor=“DENIED” operation=“open” profile=“/usr/sbin/mysqld” name=“/sys/devices/system/node/” pid=2202 comm=“mysqld” requested
mask=

2 Answers
MattyBob September 11, 2019
Accepted Answer

Nevermind. It seems I can’t read… The KB works.

I added the following to the /etc/apparmor.d/usr.sbin.mysqld file:

/proc//status r,
/sys/devices/system/node/ r,
/sys/devices/system/node/node
/meminfo r,
/sys/devices/system/node// r,
/sys/devices/system/node/* r,

Attempted to start MySQL.

Sep 11 16:39:21 ark03 mysqld[22519]: Initialization of mysqld failed: 0
Sep 11 16:39:21 ark03 systemd[1]: mysql.service: Control process exited, code=exited status=1
Sep 11 16:39:22 ark03 sshd[22363]: Failed password for root from 218.92.0.207 port 19597 ssh2
Sep 11 16:39:23 ark03 systemd[1]: mysql.service: Failed with result ‘exit-code’.
Sep 11 16:39:23 ark03 systemd[1]: Failed to start MySQL Community Server.

How the hell is a Chinese IP in the logs??

% Whois data copyright terms http://www.apnic.net/db/dbcopyright.html
% Information related to '218.90.0.0 - 218.94.255.255’
% Abuse contact for '218.90.0.0 - 218.94.255.255’

inetnum: 218.90.0.0 - 218.94.255.255
netname: CHINANET-JS
descr: CHINANET jiangsu province network
descr: China Telecom
descr: A12,Xin-Jie-Kou-Wai Street
descr: Beijing 100088

Have another answer? Share your knowledge.