linux系统mysql总是自动停止linux 运行mysql,如何让该服务停止后自动启动

用户名:lihuan1989
文章数:48
评论数:16
访问量:62852
注册日期:
阅读量:1297
阅读量:3317
阅读量:456950
阅读量:1141604
51CTO推荐博文
mysql服务不能启动的几大原因
1.存放数据库的路径的属主以及属组不是mysql
此时把/mydata/data目录的属主以及属组改为mysql即可:
# chown &R mysql.mysql /mydata/data&
是不是可以启动mysql服务了呢!
2.有关mysql的进程没有结束掉导致mysql服务不能正常启动
这种情况大部分是在做数据库备份实验的时候出现的问题:在你完全备份完数据库后,此时没有停止mysql服务,就把数据库路径下的文件全部删除进行备份恢复实验,虽然数据库完全恢复了,属组以及属主都改成了mysql,还是不能启动mysql服务。所以此时你要把以前的mysql相关的进程给结束掉,才能正常启动mysql服务了。&
此时要把mysql和mysqld这两个进程结束掉才能启动mysql服务
# kill 15811
# kill 26702
再启动mysql服务试试:
可以正常启动了吧
3.mysql配置文件不正确导致服务不能正常启动:
说明:由于配置文件涉及的内容比较多,判断起来比较麻烦,笔者在这里就不再举例了,但要告诉大家的是:
&& 更改配置文件之前,一定要事先备份一份配置文件,并在修改配置文件的时候,细心细心再细心。久而久之,问题即可尽量避免了。
4.其它问题
由于笔者水平有限,其它原因暂时未能知晓,以后会更正,请多多指教!
&本文出自 “” 博客,请务必保留此出处
了这篇文章
类别:┆阅读(0)┆评论(0)关注51Testing
Linux平台MySQL启动关闭方式总结
发表于: 10:10 &作者:潇湘隐者 & 来源:51Testing软件测试网采编
推荐标签:
  的启动方法有很多种,下面对比、总结这几种方法的一些差异和特性,下面实验的版本为MySQL 5.6。如有疏漏或不足,敬请指点一二。  1:使用mysqld启动、关闭MySQL服务  mysqld是MySQL的守护进程,我们可以用mysqld来启动、关闭MySQL服务,关于mysqld, MySQL 5.6官方介绍资料如下所示:  mysqld, also known as MySQL , is the main program that does most of the work in a MySQL installation. MySQL Server manages access to the MySQL data directory that contains databases and tables. The data directory is also the default location for other information such as log files and status files.  When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients.  The mysqld program has many options that can be specified at startup. For a complete list of options, run this command:  shell& mysqld --verbose --help  MySQL Server also has a set of system variables that affect its operation as it runs. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration. MySQL Server also has a set of status variables that provide information about its operation. You can monitor these status variables to access runtime performance characteristics.  如果MySQL是rpm方式安装的话,mysqld位于/usr/sbin下,如果MySQL是二进制安装的话,mysqld则位于bin目录下面。[root@localhost ~]# whereis mysqldmysqld: /usr/sbin/mysqld /usr/share/man/man8/mysqld.8.gz[root@localhost ~]# /usr/sbin/mysqld stop 14:52:54 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 14:52:54 9315 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 14:52:54 9315 [ERROR] Aborting 14:52:54 9315 [Note] Binlog end 14:52:54 9315 [Note] /usr/sbin/mysqld: Shutdown complete[root@localhost ~]# /usr/sbin/mysqld start 14:52:59 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 14:52:59 9316 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root! 14:52:59 9316 [ERROR] Aborting 14:52:59 9316 [Note] Binlog end 14:52:59 9316 [Note] /usr/sbin/mysqld: Shutdown complete  2:使用mysqld_safe启动、关闭MySQL服务  很多时候,人们会纠结mysqld与mysqld_safe的区别. 其实mysqld_safe是一个脚本,一个非常安全的启动、关闭MySQL服务的脚本。它实际上也是调用mysqld来启动、关闭MySQL服务。关于mysqld_safe,可以参考官方文档mysqld_safe — MySQL Server Startup Script 
搜索风云榜
51Testing官方微信
51Testing官方微博
测试知识全知道}

我要回帖

更多关于 linux 停止mysql 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信