Linux平台下启动和关闭mysql服务

来源:互联网 发布:淘宝售假影响综合评分 编辑:程序博客网 时间:2024/05/22 08:10

一、linux下查看mysql服务的两种方式:

方式一:

[root@localhost bin]ps -ef|grep mysql

方式二:

[root@localhost bin]netstat -nlp

二、linux下启动mysql服务的两种方式:

命令行方式:

[root@localhost bin]cd /usr/bin[root@localhost bin]./mysqld_safe &

服务方式:

[root@localhost ~]service mysql start如果服务在启动状态,直接重启服务用以下命令:[root@localhost ~]service mysql restart

三、linux下关闭mysql服务的两种方式:

命令行方式:

[root@localhost ~]mysqladmin -u root shutdown

服务方式:

[root@localhost ~]service mysql stop