DevHeads.net

How does MySQL really start?

It was suggested here that the script /etc/init.d/mysql is used in starting
MySQL but I have
been unable to confirm that by injecting code into it. The code seems not
to execute.

So I put "set -x" into /usr/sbin/service and at the end it executed
exec systemctl start mysql.service

Now I don't pretend to understand systemctl or systemd, but it seems likely
that this command makes it look at /lib/systemd/system/mysql.service and
this file just names

ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
ExecStart=/usr/sbin/mysqld
ExecStartPost=/usr/share/mysql/mysql-systemd-start post

And this is getting very hard for me to follow, partly because of C code
that I do not have readily at hand, and if it's as convoluted as the shell
script are, might not help me much.

What I really want to do is to inject a parameter into mysqld that will
allow me to reset the root MySQL password.

Failing that, I'd like to start over (how do I do that?)

Can anyone help?

Comments

Re: How does MySQL really start?

By Kevin O'Gorman at 01/12/2018 - 20:25

I solved it. I was trying to use code that is inactive in Xubuntu 16.04.
I needed to fool with the systemd stuff in /etc/mysql/mysql.conf.
In particular, I added my switch to mysqld.cnf in that directory.