Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop MySQL after running it using mysqld_safe?

I'm using mysqld_safe to be able to create a password for my root user (under Ubuntu 18.04, it is not asked on the installation).

To start MySQL, I have done:

$ sudo mysqld_safe --skip-grant-tables&

Now, the MySQL daemon is running and I can't stop it. Stopping it by killing the process prevent me to start another MySQL daemon because the previous one did not gave back the resources, resulting in errors like:

2018-10-31T14:50:40.238735Z 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2018-10-31T14:50:40.238815Z 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.

So how can I stop the MySQL daemon when it have been started using mysqld_safe?

like image 967
darckcrystale Avatar asked Oct 31 '18 15:10

darckcrystale


People also ask

Why is mysqld failing to stop MySQL?

After any configuration change, MySQL server needs a restart to bring the changes into effect. And, sometimes this restart can fail with errors like “Stopping mysql database server: mysqld failed! ” At Bobcares, we help server owners to fix MySQL server errors as part of our Support Services for Web Hosts.

How do I stop MySQL server from running on Windows?

First, launch the Command Prompt by pressing Windows+Rto open the Runbox and type cmdand press Enter. Second, navigate to the bin folder of the MySQL if it is not in the Window path environment. Third, use the following command to stop MySQL Server: mysqladmin -u root -p shutdown Enter password: ********

What is @mysqld_safe in MySQL?

mysqld_safe is a safe way to start a MySQL server after an error occurs. Moreover, it adds a few safety features while restarting the server after an error.

How to stop mysqld without using commands?

1 Just go to task manager. 2 Then in process, search mysqld. 3 right click on mysqld then click on stop. 4 with this process you can stop it without using commands. More ...


2 Answers

The command is:

$ mysqladmin shutdown
like image 155
darckcrystale Avatar answered Oct 05 '22 12:10

darckcrystale


The other answers did not work for me. Had to to this sudo killall -KILL mysql mysqld_safe mysqld

like image 39
Niklas Rosencrantz Avatar answered Oct 05 '22 14:10

Niklas Rosencrantz