We may want to restart our MySQL server for a number of reasons. The most likely reason for wanting to restart our MySQL database server is to load new configuration settings.
It is a good idea to ensure that no users will be accessing the database server when you are performing the restart just in case the restart fails.
Always backup your configuration files before making any changes, as fouled up configuration files are the most likely causes of a failed restart.
There are 3 main ways of restarting MySQL on Ubuntu. Either way will need us to fire up our terminal. We need to be the superuser to restart the service. Go ahead and open a terminal such as bash and type:
sudo /etc/init.d/mysql restart
Alternatively, you can use the service utility to restart MySQL by executing:
sudo service mysql restartYou may also use the restart utility to restart MySQL by executing:
sudo restart mysqlIf all goes well, you MySQL server will be restarted and any new configuration settings will be read. If your MySQL server fails to restart check any changes you made to the configuration files for errors. That is usually the most likely cause of a failed restart.