How To Start and Stop MySQL Database Server From A Shell Prompt

How To Start and Stop MySQL Database Server From A Shell Prompt

To start, stop, or restart the MySQL server on a Linux system, you can use the mysqld command with the appropriate options. Here are the commands you can use:

To start the MySQL server:

sudo mysqld
Source:w‮l.ww‬autturi.com

To stop the MySQL server:

sudo mysqladmin -u root -p shutdown

Note: you will be prompted to enter the password for the root user.

To restart the MySQL server:

sudo mysqladmin -u root -p shutdown
sudo mysqld

Note: these commands assume that MySQL is installed and configured to run as a daemon process. If you are running MySQL in standalone mode (i.e., not as a daemon), you will need to use different commands to control the MySQL server.

It's also worth noting that you may need to use sudo to run these commands, depending on your system configuration and the privileges of your user account.

Created Time:2017-10-29 22:08:33  Author:lautturi