How to restart MySql Server on linux using SSH command line

Knowledgebase Articles and news

Views
673
Useful
0
By
Admin

How to restart MySql Server on linux using SSH command line

How can i restart MySql server using SSH command line on Linux or Unix Systems?

Follow the Instructions to restart, stop and start the MySql server on a Linux or Unix Systems as per Linux/Unix Variants.

CentOS/RHEL/Fedora/Scientific Linux versions 4.x,5.x,6.x or Older Versions

Example is mention below:

### To start ###
service mysqld start
# OR
/etc/init.d/mysqld start
 
### To stop ###
service mysqld stop
# OR
/etc/init.d/mysqld stop
 
### To restart ###
service mysqld restart
# OR
/etc/init.d/mysqld restart

CentOS/RHEL/Fedora/Scientific Linux version 7.x or newer users The syntax is as follows to start mariadb/mysql server:

##  mariadb ##
systemctl start mariadb
## mysql 
systemctl start mysqld

The syntax is as follows to stop mariadb/mysql server:

##  mariadb ##
systemctl stop mariadb
## mysql 
systemctl stop mysqld

The syntax is as follows to restart mariadb/mysql server:

##  mariadb ##
systemctl restart mariadb
## mysql 
systemctl restart mysqld

Debian/Ubuntu Linux users
The syntax is as follows to start/stop/restart mysql server:

#### To start ####
/etc/init.d/mysql start
# OR
service mysql start
 
#### To stop ####
/etc/init.d/mysql stop
# OR
service mysql stop
 
#### To restart ####
/etc/init.d/mysql restart
# OR
service mysql restart

FreeBSD Unix server user

To start the Mysql server type:

# /usr/local/etc/rc.d/mysql-server start

To restart the Mysql server type:

# /usr/local/etc/rc.d/mysql-server restart

To stop the Mysql server type:

# /usr/local/etc/rc.d/mysql-server stop