Linux启动/停止/重启Mysql数据库的方法
1、查看mysql版本
方法一:status;
方法二:select version();
2、Mysql启动、停止、重启常用命令
a、启动方式
1、使用 service 启动:
[root@localhost /]# service mysqld start (5.0版本是mysqld)
[root@szxdb etc]# service mysql start (5.5.7版本是mysql)
2、使用 mysqld 脚本启动:
/etc/inint.d/mysqld start
3、使用 safe_mysqld 启动:
safe_mysqld&
b、停止
1、使用 service 启动:
service mysqld stop
2、使用 mysqld 脚本启动:
/etc/inint.d/mysqld stop
3、mysqladmin shutdown
c、重启
1、使用 service 启动:
service mysqld restart
service mysql restart (5.5.7版本命令)
2、使用 mysqld 脚本启动:
/etc/init.d/mysqld restart
service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误
service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下:
[[email protected] ~]# service mysql start
mysql: unrecognized service
[[email protected] ~]# service mysql restart
mysql: unrecognized service
[[email protected] ~]# rpm -q mysql 查询发现mysql已经正常安装
mysql-5.1.52-jason.1
[[email protected] ~]# /etc/rc.d/init.d/mysqld start 直接启动没问题
Starting mysqld: [ OK ]
[[email protected] ~]# ls /etc/rc.d/init.d/mysqld -l
-rwxr-xr-x 1 root root 5509 Dec 18 02:31 /etc/rc.d/init.d/mysqld
[[email protected] ~]# chkconfig mysqld on 设置mysql开机启动
[[email protected] ~]# chmod 755 /etc/rc.d/init.d/mysqld 修改mysqld执行权限
[[email protected] ~]# service mysqld start 搞定
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld start
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld status
mysqld (pid 9487) is running...
1、查看mysql版本
方法一:status;
方法二:select version();
2、Mysql启动、停止、重启常用命令
a、启动方式
1、使用 service 启动:
[root@localhost /]# service mysqld start (5.0版本是mysqld)
[root@szxdb etc]# service mysql start (5.5.7版本是mysql)
2、使用 mysqld 脚本启动:
/etc/inint.d/mysqld start
3、使用 safe_mysqld 启动:
safe_mysqld&
b、停止
1、使用 service 启动:
service mysqld stop
2、使用 mysqld 脚本启动:
/etc/inint.d/mysqld stop
3、mysqladmin shutdown
c、重启
1、使用 service 启动:
service mysqld restart
service mysql restart (5.5.7版本命令)
2、使用 mysqld 脚本启动:
/etc/init.d/mysqld restart
service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误
service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下:
[[email protected] ~]# service mysql start
mysql: unrecognized service
[[email protected] ~]# service mysql restart
mysql: unrecognized service
[[email protected] ~]# rpm -q mysql 查询发现mysql已经正常安装
mysql-5.1.52-jason.1
[[email protected] ~]# /etc/rc.d/init.d/mysqld start 直接启动没问题
Starting mysqld: [ OK ]
[[email protected] ~]# ls /etc/rc.d/init.d/mysqld -l
-rwxr-xr-x 1 root root 5509 Dec 18 02:31 /etc/rc.d/init.d/mysqld
[[email protected] ~]# chkconfig mysqld on 设置mysql开机启动
[[email protected] ~]# chmod 755 /etc/rc.d/init.d/mysqld 修改mysqld执行权限
[[email protected] ~]# service mysqld start 搞定
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld start
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld status
mysqld (pid 9487) is running...
service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下:
[[email protected] ~]# service mysql start
mysql: unrecognized service
[[email protected] ~]# service mysql restart
mysql: unrecognized service
[[email protected] ~]# rpm -q mysql 查询发现mysql已经正常安装
mysql-5.1.52-jason.1
[[email protected] ~]# /etc/rc.d/init.d/mysqld start 直接启动没问题
Starting mysqld: [ OK ]
[[email protected] ~]# ls /etc/rc.d/init.d/mysqld -l
-rwxr-xr-x 1 root root 5509 Dec 18 02:31 /etc/rc.d/init.d/mysqld
[[email protected] ~]# chkconfig mysqld on 设置mysql开机启动
[[email protected] ~]# chmod 755 /etc/rc.d/init.d/mysqld 修改mysqld执行权限
[[email protected] ~]# service mysqld start 搞定
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld start
Starting mysqld: [ OK ]
[[email protected] ~]# service mysqld status
mysqld (pid 9487) is running...