linux安装mysql
(1)如果电脑联网了可以通过 yum install mysql-server (2)如果yum没办法安装,需要单独下载安装 1. 如果没wget yum -y install wget 2. 下载 mysql-community-release-el7-5.noarch.rpm wget http://repo.mysql.com/mysql-community-release-el7.rpm 3. 通过rpm安装mysql rpm -ivh mysql-community-release-el7.rpm 4. 安装好之后,在继续通过yum软件包,出现的提示都按Y安装 yum install mysql-server 5. 安装好之后,确认一下是否安装好了。 rpm -qa|grep mysql 6. 启动mysql服务, 并查看状态 active(running) systemctl start mysqld.service systemctl status mysqld.service 7. 查看默认密码 grep 'temporary password' /var/log/ysqld.log 8. 运行mysql mysql -uroot -p 9. 修改密码,密码必须为强密码,否则会保错 show databases; alter user 'root'@'localhost' identified by 'root123'; #报错 alter user 'root'@'localhost' identified by 'admin@123';