How to restart the MySQL database?

In MySQL, you can restart the database using the following methods:

  1. Utilize the command line tool:
  2. Enter the following command in the command line: mysqladmin -u root -p shutdown.
  3. The system will prompt you to enter the root password for MySQL, enter the password and press the Enter key.
  4. Next, start the MySQL service using the following command: sudo service mysql start.
  5. Utilize system service management tools:
  6. To restart the MySQL service on a Linux system, use the following command: sudo service mysql restart.
  7. In the Windows system, open the Service Manager (you can do this through the Control Panel or by typing services.msc in the command line), locate the MySQL service, right-click, and select restart.

Regardless of the method used, after restarting the database, you should be able to reconnect to the MySQL server.

bannerAds