When I’m use the find command to locate the MySQL location, it returns the below paths. But, I want to restart the MySQL. If I stop the path (/usr/bin/mysql) it shows the error
[Access denied to user ‘root’@’localhost’ with password=’NO]’
so, Which MySQL will be get restart in the below paths ?
/usr/bin/mysql
/usr/share/mysql
/usr/lib/mysql
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql
/usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql
/usr/lib64/mysql
/var/lib/mysql
/var/lib/mysql/mysql
to stop mysql account is:
sudo mysqladmin -h localhost -u root -p shutdown
to start is:
sudo systemctl start mysql.service
to confirm:
sudo mysql -h localhost -u root -p
NB:
the default password for root account is root
**not sure but i think this closes connection for all accounts & also starts for all accounts though you have stop using an account with privilege access/root access by using the grant statement.
example
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'localhost';
source http://www.luciopanasci.it/Ebooks/MySQL%20Cookbook,%203rd%20Edition.pdf
page 2 topic 1.1**