Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi There,
I am using Ubuntu 18.04 and I am trying to move my mysql data directory to external HDD.
I followed all the steps but at end when I tried to start the Mysql server it gives me below error.
● mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2018-11-20 10:30:52 EST; 4s ago Process: 24879 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, Process: 24869 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) Main PID: 1481 (code=exited, status=0/SUCCESS)
Nov 20 10:30:52 Shivam systemd[1]: mysql.service: Service hold-off time over, scheduling restart. Nov 20 10:30:52 Shivam systemd[1]: mysql.service: Scheduled restart job, restart counter is at 5. Nov 20 10:30:52 Shivam systemd[1]: Stopped MySQL Community Server. Nov 20 10:30:52 Shivam systemd[1]: mysql.service: Start request repeated too quickly. Nov 20 10:30:52 Shivam systemd[1]: mysql.service: Failed with result ‘exit-code’. Nov 20 10:30:52 Shivam systemd[1]: Failed to start MySQL Community Server.
==============================================================
Can you suggest me what is missing and how to fix this?
Thanks, Shivam
This comment has been deleted
have used this tutorial many times before with success, but now running into issues on 18.04 with an external ssd mounted as:
/dev/sda1 on /data type ext4 (rw,nosuid,nodev,relatime,data=ordered,x-gvfs-show)
mysql works fine with the data dir in the default location (i’ve moved it out, broken it, and moved it back and it worked, just to be sure). i’ve triple-checked apparmor and i dont think that’s the issue.
i think it has something to do with ownership or permissions on the parent folder (the /data mount point) since the mysql folder is just the rsync’ed one from the default location and all the qonership and permissions are intact.
here are the relevant permissions for the data directory.
drwx------ 4 root root 4096 Dec 27 16:28 data
and the permissions inside /data
/data# ls -la
total 28
drwx------ 4 root root 4096 Dec 27 16:28 .
drwxr-xr-x 25 root root 4096 Dec 27 16:22 ..
drwx------ 2 root root 16384 Dec 23 10:19 lost+found
drwx------ 5 mysql mysql 4096 Dec 27 17:12 mysql
any suggestions appreciated. mysql fails to start with a 13 error trying to write the test temp files so im pretty sure this is what’s what. just not sure how to fix.
This comment has been deleted