0

I'm using Ubuntu 18.04 LTS 64-bit and I'm really been struggling with this - can anyone tell me where I'm going wrong?

I've had my MySQL files on a separate big disk for ages but the said big disk died suddenly. So I put a new disk in new and gleaming 3TB of it. For complicated reasons to do with a company whose name reminds you of a big South American river I actually ended up with 2 3TB disks.

I had to reinstall the server as all the copies of my data directory had got clobbered. I did have backups of my databases, don't worry.

However after reinstalling the server and changing the apparmor file and the data files directory as described in various places as I had before, mysql won't start.

If I try sudo /usr/sbin/mysqld it says:

2019-09-20T09:35:09.083922Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.27) starting as process 16284 ... 2019-09-20T09:35:09.085612Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

If I try setting it back everything is fine. But the /var/lib/mysql filesystem isn't big enough.

I've tried keeping the mysql config the same and doing a symlink from /var/lib/mysql to /bigdisk/mysql that still fails. All the permissions seem right

Please help because I've just had 2 big disks put in and I can't use them!

I noticed that I now seem to be dealing with MySQL "community server" does that mean anything?

4
  • 1
    Which LTS release of Ubuntu are you talking about?
    – guiverc
    Sep 20, 2019 at 12:00
  • Sorry 18.04 don't know how that got wiped Sep 20, 2019 at 12:23
  • You shouldn't run MySQL as root; it should run as its own user (mysql) which you accomplish by starting it with sudo systemctl start mysql. The symlink solution is in your case probably the best; what message do you get if you try it that way? Finally: the "community server" is indeed what you need.
    – Jos
    Sep 20, 2019 at 13:28
  • I tried that and it still failed on startup. No particular explanation but "dmesg" has as final line :[29884.356109] audit: type=1400 audit(1568993017.872:998): apparmor="DENIED" operation="capable" profile="/usr/sbin/mysqld" pid=23472 comm="mysqld" capability=2 capname="dac_read_search" [29884.379316] audit: type=1400 audit(1568993017.896:999): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=23474 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=121 ouid=0 Sep 20, 2019 at 15:28

1 Answer 1

0

Apologies after all that wrestling the solution was very simple.

When I formatted the disks (from the "disks" gui it helpfull created the root directory owned by me (so I could see things in it as well as root but no one else) and with permissions 700.

Makde that 755 owned by root and all was sweetness and light.

Typically I discovered that doing something else (trying to get Virtualbox to work).

So sorry for annoying everyone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .