Under the Linux platform, you can view the status of the MySQL service with the following command:
[Root@localhost ~]# NETSTAT-NLP
Active Internet connections (only servers)
Proto recv-q Send-q Local address Foreign address State Pid/program Name
TCP 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN 2182/./hpiod
TCP 0 0 0.0.0.0:5989 0.0.0.0:* LISTEN 2611/cimservermain
TCP 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2369/mysqld
TCP 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1833/portmap
TCP 0 0 0.0.0.0:784 0.0.0.0:* LISTEN 1874/rpc.statd
...
[Root@localhost ~]#
Where port number 3306 is the MySQL server listening port;
There are two ways to start and shut down MySQL
1) Imperative mode
Root@localhost sbin]# cd/usr/bin/
[Root@localhost bin]#./mysqld_safe &
[1] 12788
[Root@localhost bin]# 150507 01:25:46 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err '.
150507 01:25:47 Mysqld_safe starting mysqld daemon with databases From/var/lib/mysql
[Root@localhost bin]# mysqladmin-u root-p shutdown
Enter Password:
150507 01:26:48 mysqld_safe mysqld from PID File/var/lib/mysql/localhost.localdomain.pid ended
[1]+ done./mysqld_safe
[Root@localhost bin]#
2) The way of service
[root@localhost bin]# service MySQL start
Starting MySQL. [OK]
[root@localhost bin]# service MySQL restart
Shutting down MySQL. [OK]
Starting MySQL. [OK]
[root@localhost bin]# service MySQL Stop
Shutting down MySQL. [OK]
[Root@localhost bin]#