Centos7下默认是找不到mysql server的,运行命令会提示找不到:
yum install mysql-server -y

需要先下载mysql的repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装mysql的rpm包
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
然后再运行命令就可以安装了
yum install mysql-server -y
启动mysql:
service mysqld start
用root用户登录mysql
mysql -u root

网友评论