linux下MySQL的启动关闭(本文基于centos6.4、mysql5.7.3),mysql安装在/usr/local/mysql目录下:
mysql的安装请参考:http://note.t4x.org/system/centos-nginx-mysql-php/
0 1 2 3 4 5 6 7 8 9 |
[root@lnmp ~]# /usr/local/mysql/bin/mysql --version /usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.7.3-m13, for Linux (x86_64) using EditLine wrapper [root@lnmp ~]# /bin/cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld #将mysql.server拷贝到启动项 [root@lnmp ~]# /etc/init.d/mysqld start #启动MYSQL数据库 Starting MySQL.... SUCCESS! [root@lnmp ~]# netstat -tunlp|grep 3306 #查看是否开启了mysql数据库端口3306 tcp 0 0 :::3306 :::* LISTEN 1773/mysqld [root@lnmp ~]# /etc/init.d/mysqld stop #停止mysql数据库 Shutting down MySQL.. SUCCESS! [root@lnmp ~]# netstat -tunlp|grep 3306 #查看是否关闭了mysql的默认端口3306 |
备注:你可以将/usr/local/mysql/bin加入PATH中。这样可以直接输入mysql或者mysqladmin,不用输入全路径。
申明:本文由BYRD原创(基于Centos6.4 X64、mysql5.7.3),未经许可禁止转载! SourceByrd's Weblog-https://note.t4x.org/database/mysql-commands-summary/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!