1

How can i stop mysql server (installed using binary installation under /usr/local/mysql)?

When i go in /usr/local/mysql/bin and execute command

mysqld stop i get following error message :

[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
[ERROR] Aborting
[Note] mysqld: Shutdown complete

and i can still see process for mysql server.

same happens when i try to do it with mysqld in /etc/init.d.

muru
  • 207,228

5 Answers5

5

Assuming that you are running an up-to-date Ubuntu and you are already root, as you mentioned, the command is:

service mysql stop

or

/etc/init.d/mysql stop

Because of your installation, you should try this:

sudo -u mysql /usr/local/mysql/bin/mysqld stop

Frantique
  • 8,673
2

Use sudo mysqld stop to stop it as root.

hope it helped.

denNorske
  • 983
2
sudo /etc/init.d/mysqld stop

should do it.

1

You have elected not to install the mysql package provided by Ubuntu and have instead manually installed a version into /usr/local - as such you are not doing things the normal "Ubuntu" way and the advice you get here may be affected.

The normal way of install MySQL in Ubuntu is by installing the package provided by Ubuntu using something like sudo apt-get install mysql-server. Installing something manually into /usr/local with a make or install script should be something done only when you have a specific reason to do so and you have a greater level of technical skill and knowledge, and willingness to set it up correctly yourself. You'll also need to do updates and security patches manually because it won't be done by Ubuntu.

Based on your level of technical knowledge of Ubuntu I don't think installing something manually into /usr/local is for you. Unless you respond with a good reason for not being able to use the one included with Ubuntu and you really want to learn more, I'd advise removing that MySQL and installing the Ubuntu one with sudo apt-get install mysql-server.

After doing this, you'll be able to follow all the normal instructions you find on the Ubuntu wikis and howtos.

thomasrutter
  • 37,804
-2

try the following:

quit;

this worked for me...then i just got the msg: "bye". then it was showing again to enter a comand as the USER@user>, not as MYSQL>. Help this works!