Coder Perfect

How can a remote MySQL server on Ubuntu linux be restarted?

Problem

Ubuntu 12.04 LTS is the operating system I’m running.

There is one on a remote MySQL server. It’s something I’d like to restart.

Please provide detailed step-by-step directions for restarting the MySQL server.

The database server details for MYSQL that I acquired from the phpMyAdmin UI are as follows:

Server: Localhost via UNIX socket
Server type: MySQL
Server version: 5.5.40-0ubuntu0.14.04.1 - (Ubuntu)
Protocol version: 10
User: root@localhost
Server charset: UTF-8 Unicode (utf8)

Could someone please assist me?

Asked by PHPFan

Solution #1

If your mySQL service is called anything different, such as mysqld, you may need to alter the command or try this: restart mysql sudo /etc/init.d/mysql

Answered by Huey

Solution #2

sudo service mysql stop;
sudo service mysql start;

If the preceding procedure does not work, use the code provided above to stop and restart the MySQL server.

Answered by Ram Neduri

Solution #3

Another way is:

systemctl restart mysql

Answered by felixmpa

Solution #4

Reference

Answered by Ayman Elshehawy

Solution #5

When I SSH’d into my AWS Lightsail wordpress instance, I was able to do the following: restart mysql sudo /opt/bitnami/ctlscript.sh This is what I discovered here: https://docs.bitnami.com/aws/infrastructure/mysql/administration/control-services/

Answered by Web Dev guy

Post is based on https://stackoverflow.com/questions/30101555/how-to-restart-remote-mysql-server-running-on-ubuntu-linux