Linux yum 命令安装mysql8.0
一 ,做好安装前的清理工作
rpm -pa | grep mysql 或者 rpm -qa | grep -i mysql
yum remove mysql-xxx-xxx
find / -name mysql
rm -rf /xxx/xxx/xxx
二 , 下载对应的安装包
下载链接:https://dev.mysql.com/downloads/repo/yum/
三 , 安装mysql
执行rpm文件
rpm -ivh mysql57-community-release-el7-11.noarch.rpm
安装mysql
yum install mysql-community-server
启动mysql服务
serivce mysql start
获取初始化密码
cat /var/log/mysqld.log | grep password
进入数据库修改密码
mysql -uroot -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
开启远程访问
use mysql;
update user set host='%' where user='root';
开放3306端口号
vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
service iptables restart
相关推荐
lpfvip00 2020-10-07
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11