一般我们在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