
注意标题中重启是带了引号的
生产环境中的mysql server, 一般情况下,是要尽量避免重启的
但又时间却又面临这种场景
mysql的慢日志,错误日志需要定时切割出来。
一些影响性能的参数需要微调,我们希望mysql能平滑地加载新配置而不中断服务
其实,只要给mysqld进程发送-HUP信号即可,mysqld接收到这个信号后,会重新生成日志
或使用 service mysqld reload 也可
另外一些参数微调,建议是在mysql CLI方式下使用 set global NAME=Value方式设置好之后,再将其保存到/etc/my.cnf配置文件中
centos7自带是mariadb,一个mysql的变种。查看有没有安装过:yum list installed mysql*rpm -qa | grep mysql*安装mysql软件(mariadb)yum install mysql*启动mysqlsystemctl start mariadb.service 或者 systemctl start mysqld.service结束systemctl stop mariadb.service 或者 systemctl stop mysqld.service重启systemctl restart mariadb.service 或者 systemctl restart mysqld.service开机自启systemctl enable mariadb.service 或者 systemctl enable mysqld.service在Debian/Ubuntu系的Linux系统上,mysql的服务名是mysql,重启服务应该用 service mysql restart在RHEL/CentOS系的Linux系统上,mysql的服务名是mysqld,重启服务应该用 service mysqld restart
如果你的课本是基于一个系统来讲的,start和restart使用的服务名应该是一样的,要么都是mysql要么都是mysqld。
看书+实践才能学会Linux,命令敲上一试就都清楚了。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)