ITPub博客

首页 > IT基础架构 > 数据安全 > mysql 启停三种方式

mysql 启停三种方式

投稿 数据安全 作者:long_small 时间:2022-11-05 18:56:11 0 删除 编辑

一  root:

使用service

[root@centospg0326 ~]# service mysqld start


[root@centospg0326 ~]# service mysqld stop

Shutting down MySQL.. SUCCESS!


[root@centospg0326 ~]# ps -ef |grep mysql

root      10367  10090  0 17:52 pts/1    00:00:00 su - mysql

mysql     10368  10367  0 17:52 pts/1    00:00:00 -bash

root      10647      1  0 18:03 pts/2    00:00:00 /bin/sh /usr/local/mysql-5.7.31/bin/mysqld_safe --datadir=/usr/local/mysql-5.7.31/data --pid-file=/usr/local/mysql-5.7.31/data/centospg0326.pid

mysql     10788  10647  3 18:03 pts/2    00:00:00 /usr/local/mysql-5.7.31/bin/mysqld --basedir=/usr/local/mysql-5.7.31 --datadir=/usr/local/mysql-5.7.31/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=centospg0326.err --pid-file=/usr/local/mysql-5.7.31/data/centospg0326.pid --port=3306

root      10818  10475  0 18:03 pts/2    00:00:00 grep --color=auto mysql


二   

启动:/usr/local/mysql-5.7.31/bin/mysqld_safe --defaults-file=/etc/my.cnf

关闭:

[root@centospg0326 ~]# find / -name 'mysql.sock' -print

/tmp/mysql.sock

[root@centospg0326 ~]# /usr/local/mysql-5.7.31/bin/mysqladmin -u root -S /tmp/mysql.sock shutdown 


三 ,如下 ./mysqld --defaults-file=/etc/my.cnf --user=root,待验证

[root@centospg0326 bin]# ./mysqld --defaults-file=/etc/my.cnf --user=root

2022-11-05T10:53:07.169446Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2022-11-05T10:53:07.169815Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled

2022-11-05T10:53:07.169841Z 0 [Note] ./mysqld (mysqld 5.7.31) starting as process 13536 ...

2022-11-05T10:53:07.169871Z 0 [ERROR] Can't find error-message file '/usr/local/mysql-5.7.31/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25846553/viewspace-2922022/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql字符集
请登录后发表评论 登录
全部评论
吕生龙,现就职于IBM,db2 dba,oracle 10G OCP

注册时间:2020-04-07

  • 博文量
    64
  • 访问量
    66977