Centos6.9安装Mysql

Mysql的Yum安装
经过FileZilla将下载的rpm文件上传到服务器node

而后rpm -Uvh mysql80-community-release-el6-1.noarch.rpmmysql

一直报错“mysql57-community-release conflicts with mysql80-community-release-el6-1.noarch”
rpm -qa | grep mysql 键入上述命令的时候,发现有下面2个mysql相关的东西,stackoverflow建议remove掉。经过下面指令remove
rpm -e --nodeps mysql57-community-release-el7-10.noarch
rpm -e --nodeps mysql-libs-5.1.73-8.el6_8.x86_64
完成以后,就能够正常下载,必要步骤须要手动yes确认,直至complete。sql

开启mysql服务—— service mysqld start
mysql安装成功后建立的超级用户'root'@'localhost'的密码会被存储在/var/log/mysqld.log,能够使用以下命令查看密码
grep 'temporary password' /var/log/mysqld.log
使用生成的密码及root用户登录数据库,并修改密码
mysql -uroot -p 而后键入刚刚查询出来的密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';数据库

相关文章
相关标签/搜索