+5 votes
1.3k views
Start, stop or restart MySQL service on Linux, Windows or mac from console

in Databases by (551k points)
reopened | 1.3k views

1 Answer

+3 votes
Best answer

1. How to start, stop or restart MySQL services in Windows 10
2. How to start, stop or restart MySQL services from the MySQL platform in Windows 10
3. How to start, stop or restart MySQL services from system services in Windows 10
4. How to start, stop or restart MySQL services from CMD in Windows 10
5. How to start, stop or restart MySQL services on Linux
6. How to start, stop or restart MySQL services from the MySQL platform in macOS
7. How to start, stop or restart MySQL services from System Preferences in macOS
8. How to start, stop or restart MySQL services from the terminal in macOS
9. How to start, stop or restart MySQL services using DBngin
10. How to start, stop or restart MySQL services using WHM

Database management is one of the most common tasks in small, medium and large companies since these allow a much more detailed and direct control over the data that should be recorded, as well as the structure that should be given to same.

Although there are several options at the database level, one of the most popular and used by thousands of administrators is MySQL which allows us to have a SQL database server (Structured Query Language) with functions and outstanding features such as security, access speed, scalability, support of multiple users and execution of various processes simultaneously.

When setting up a MySQL server , independent of the operating system used, it is natural that with the passage of time and when adding more and more tables and bases, at some point MySQL can generate some type of error either loading the databases, accessing to the queries or generating execution errors, if this happens to you, in TechnoWikis we give you a practical tip that will help you to refresh MySQL and is to stop or restart the MySQL services and thus be able to work in a complete and integral way with the bases created.

MySQL service startup

Let's see 3 options depending on your version.

 /etc/init.d/mysqld start service mysqld start service mysql start 

Stop the MySQL service

We have 3 options depending on the version.

 /etc/init.d/mysqld stop service mysqld stop service mysql stop 

Restart the MySQL service

 /etc/init.d/mysqld restart service mysqld restart service mysql restart 

You will learn to perform this process simply on macOS, Linux and Windows.
If you do not have MySQL installed you can go to the following link and download the appropriate version:

MySQL

1. How to start, stop or restart MySQL services in Windows 10

From the moment we install and configure our MySQL server in Windows 10, the system is responsible for restarting and stopping MySQL services to complete the installation processes properly. Now, if we have our server set up some time ago, we have some ways to carry out the tasks to start, restart or stop the services.

image

2. How to start, stop or restart MySQL services from the MySQL platform in Windows 10

Step 1


The first is using the MySQL platform itself, for this we must first log in to MySQL with the respective credentials: image

Step 2


Once we establish connectivity, we will go to the Server menu and there we select the option "Startup / Shutdown": image

Step 3


We will be redirected to the next section where we can see the current status of the MySQL server: image

Step 4


As we see in this case, the server is active (running), to stop it, just click on the Stop Server button and we will see a summary of the task executed and verify that the server is stopped: image

Step 5


To start it, we click on the "Start Server" button and we must enter our root password to complete the startup process: image

3. How to start, stop or restart MySQL services from system services in Windows 10

Another method offered by Windows 10 to perform these activities is directly in the operating system services, when we install MySQL on Windows 10, a special service for MySQL is automatically created

Step 1


To verify this, we will use the following key combination and execute the services.msc command:

+ R

 services.msc 

image

Step 2


Click on OK and in the pop-up window we locate the MySQL service:

image

Step 3


We right click on the service mentioned and the options displayed will be possible. There we select the necessary option for our MySQL server.

  • Stop the service
  • Restart service
  • Start it if it has been stopped

image

4. How to start, stop or restart MySQL services from CMD in Windows 10

Another option available is to perform this task from the command prompt as administrators, for this we must access the console and execute the following:

 C: \ Program Files \ MySQL \ MySQL Server 5.7 \ bin \ mysqld 

image

Note

We can also execute the following order:

 C: \ Program Files \ MySQL \ MySQL Server 8.0 \ bin \ mysqladmin "-u root shutdown 

Thus, Windows allows us to perform these actions in various ways, but each of them practical.

5. How to start, stop or restart MySQL services on Linux


In Linux environments the tasks of starting, restarting or stopping the server are a bit simpler since these are worked from the console directly, so, in Linux, in this example Ubuntu Server 19.04

Step 1


We can first know the status of the MySQL server by running the following:

 sudo service mysql status 

image

Step 2


Now, to stop the service we will run:

 service mysql stop 

image

Step 3


To start the service we execute:

 service mysql start 

image

Step 4


If the objective is to restart the service we must execute the following:

 service mysql restart 

image

Step 5


Additionally in Linux we can execute the following commands to perform these actions:

 /etc/init.d/mysqld start /etc/init.d/mysqld stop /etc/init.d/mysqld restart service mysqld start service mysqld stop service mysqld restart 

6. How to start, stop or restart MySQL services from the MySQL platform in macOS


As in Windows 10, macOS offers us some options to perform this process in a useful way, we will see each one.

When installing MySQL on macOS, the MySQL administration platform will be installed by default, so that when we start the connection we can go to the Server menu and select the Startup / Shutdown option. After this we repeat the steps previously seen in Windows 10 to stop or start the MySQL service.

image

7. How to start, stop or restart MySQL services from System Preferences in macOS

Step 1


MySQL has a particularity and it is that as such it is not hosted in applications, all its configuration will be available from "System Preferences": image

Step 2


By clicking on MySQL we will be redirected to the configuration window and in the "Instances" tab we can see the current version of MySQL used and stop (if active) the service: image

Step 3


Clicking on Stop MySQL Server will need to enter the administrator password to authorize the action:

image

Step 4


Click on OK and we will see that the server is stopped and there is the option to start it with the "Start MySQL Server" button: image

8. How to start, stop or restart MySQL services from the terminal in macOS


The macOS terminal allows us to perform the task of starting or stopping the MySQL service in a simple way.

Step 1


If we want to start the service, just run the following line:

 sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist 

image

Step 2


If you wish to stop the service, we will execute the following:

 sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist 

image

9. How to start, stop or restart MySQL services using DBngin

Step 1


This is a free utility with which we can manage various active databases in the system, you can work in parallel with PostgreSQL, MySQL, Redis and more, your free download is available at the following link:

DBngin

Step 2


Its use is simple, once installed we create a new instance with the type of database desired, in this case MySQL, we assign a name and if this database exists we will see the following:

image

Step 3


There we click on Start to start the service and after that we can click on Stop to stop the MySQL service:

image

10. How to start, stop or restart MySQL services using WHM


WHM (Web Host Manager) is a control panel in Linux environments thanks to which we will be able to manage various system parameters both at hardware and software level, working together with CPanel facilitating the use and management of hundreds of parameters .

Step 1


The first step is to access through the server's IP address and enter our access credentials: image

Step 2


Once we access, we enter the search engine "restart" and we will see a list in the menu on the left with all the services that we can restart, in this case we select "SQL (Server) MySQL":

image

Step 3


Now we click on Yes and the MySQL service restart process will be carried out:

image

The options are varied and complete to start, stop or restart our MySQL service on Windows, macOS or Linux in an integral way.


by (3.5m points)
edited by

Related questions

+5 votes
1 answer
asked Nov 16, 2022 in Linux/Unix by backtothefuture (551k points) | 56 views
+3 votes
1 answer
asked Nov 14, 2019 in Windows 10 by backtothefuture (551k points) | 271 views
+5 votes
1 answer
asked Sep 30, 2019 in Databases by backtothefuture (551k points) | 1.6k views
+4 votes
1 answer
asked Jun 23, 2019 in Databases by backtothefuture (551k points) | 210 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,633 questions
10,765 answers
510 comments
3 users