mysql启动和关闭另外的方式

一般我们在windows平台中使用net start/stop mysql的方式启动。

其实还有其他方式。
在命令行窗口下切换到mysql安装目录bin目录下

启动:

mysqld -nt --console
服务器在前台运行,需另外开一个控制台窗口来运行客户端程序

##停止:

mysqladmin -u root -p shutdown

以下是在linux运行的,发现停止是可以的

[root@localhost bin]# service  mysql status
 SUCCESS! MySQL running (116635)
[root@localhost bin]# 
[root@localhost bin]# mysqladmin -u root -p shutdown
Enter password:
[root@localhost bin]# service mysql status
 ERROR! MySQL is not running

但是启动命令发现windows和linux下都会报错如下:

[root@localhost bin]# mysqld -nt --console
2018-12-12 10:26:24 0 [Warning] option 'new': boolean value 't' wasn't recognized. Set to OFF.
2018-12-12 10:26:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-12-12 10:26:24 0 [Note] mysqld (mysqld 5.6.33) starting as process 117126 ...
2018-12-12 10:26:24 117126 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2018-12-12 10:26:24 117126 [ERROR] Aborting

2018-12-12 10:26:24 117126 [Note] Binlog end
2018-12-12 10:26:24 117126 [Note] mysqld: Shutdown complete

[root@localhost bin]# mysqld -nt --console
2018-12-12 10:26:24 0 [Warning] option 'new': boolean value 't' wasn't recognized. Set to OFF.
2018-12-12 10:26:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-12-12 10:26:24 0 [Note] mysqld (mysqld 5.6.33) starting as process 117126 ...
2018-12-12 10:26:24 117126 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!

2018-12-12 10:26:24 117126 [ERROR] Aborting

2018-12-12 10:26:24 117126 [Note] Binlog end
2018-12-12 10:26:24 117126 [Note] mysqld: Shutdown complete

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黄宝康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值