“centos”7怎么重启mysql5.7?
有三种方法
1.将mysqld放到/etc/init.d,用/etc/init.d/mysqld restart命令重启;
(cp mysql-5.5.31/support-files/mysql.server /etc/init.d/mysqld)
2.用systemctl systemctl restart mysql或者systemctl restart mariadb;
3.service mysql restart,service mariadb restart。
centos 7 安装 mysql 5.7的步骤
1.创建 /data/mysql文件夹,mkdir /data,mkdir /data/mysql;
2.添加用户组和用户groupadd mysql,useradd -r -g mysql mysql;
3.解压文件到/var/lib,cd /var/lib/;
tar zxf /usr/local/tools/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz;
mv mysql-5.7.17-linux-glibc2.5-x86_64/ mysql;
4.复制my-default.cnf到etc下cd mysql;
cp support-files/my-default.cnf /etc/my.cnf;
5.修改/etc/my.cnf,basedir=/var/lib/mysql;
datadir=/data/mysql;
6.设置mysql开机启动,# 添加为系统服务,chkconfig --add mysql;
# 设定权限
chkconfig --level 2345 mysql on;
# 查看
chkconfig --list;
7.mysql已经安装完成,重启系统试试吧。
1. 设置开机自启动命令。chkconfig mysqld on
2. 打命令/etc/init.d/mysqld start/etc/init.d/mysqld stop
3. centos6以前打命令services mysqld startservices mysqld stop
4. centos7打命令systemctlsystemctl start mysqldsystemctl stop mysqld