赞
踩
rm -rf /var/lib/mysql
rm -f /etc/my.cnf
rpm -qa | grep mysql
卸载干净: 若执行命令后,什么反应都没,则表示已经卸载干净;
未卸载干净: 继续执行 yum remove xxx;
yum remove xxx
sudo wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
sudo yum localinstall mysql80-community-release-el7-3.noarch.rpm
sudo yum install mysql-community-server --nogpgcheck
注意:如果出现Error: Unable to find a match: mysql-community-server 错误则执行下列语句
sudo yum module disable mysql
sudo yum -y install mysql-community-server
注意:centos8 需要执行如下安装
sudo dnf install compat-openssl10
yum install libaio
在(/etc/my.cnf)中添加 lower_case_table_names=1
在(/etc/my.cnf)中添加port=3309
在(/etc/my.cnf)中添加expire_logs_days=7
sudo service mysqld start
sudo grep 'temporary password' /var/log/mysqld.log
sudo mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'kjd!L*C!$B8tiErq';
create user 'root'@'%'identified by 'kjd!L*C!$B8tiErq';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'kjd!L*C!$B8tiErq';
flush privileges;
4.1 启动服务
service mysqld start
4.2 重启服务
service mysqld restart
4.3 关闭服务
service mysqld restart
4.4 服务状态
sudo service mysqld status
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。