CentOS7RPM安装MySQL5.7
1:环境
操作系统:CentOS Linux release 7.2.1511
MySQL版本:mysql-5.7.17-1
2:下载RPM安装包
前往MySQL官⽹下载RPM安装包,本⽂使⽤的版本是mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
temp.gif
下载完成之后,将安装包上传⾄服务器,然后解压tar xvf mysql-5.7.17-1.el7.x86_64.rpm-bundle.tar
截图20161222112545.png
3:安装
4:数据库初始化
mysql下载下来没安装包执⾏mysqld --initialize --user=mysql命令初始化,初始化完成后,会⽣成⼀个root账号密码,位于/var/log⽬录下的mysqld.log⽂件最后⼀⾏现在,使⽤上述密码启动数据库
systemctl start mysqld
mysql -uroot -p
5:修改密码
alter user 'root'@'localhost' identified by 'new_password'
6:添加远程⽤户
使⽤如下sql添加远程⽤户
grant all privileges on *.* to 'account'@'%' identified by 'password' with grant option