centos6.5 使用mysql的rpm包安装mysql

先上mysql官方下载mysql 对应版本 centos6 就选 Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 64-bit), RPM Bundle

 

http://dev.mysql.com/downloads/mysql/

http://dev.mysql.com/downloads/file/?id=466158

http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.16-1.el6.x86_64.rpm-bundle.tar

1、解压下载了rpm包安装
yum –nogpgcheck localinstall mysql*
2、关闭密码策略
/etc/my.cnf
增加
validate_password=off
重启数据库
3、查找初始密码
grep ‘temporary password’ /var/log/mysqld.log
4、修改密码
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘123456’;
5、打开远程连接权限
GRANT ALL PRIVILEGES ON *.* TO ‘root’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
6、创建用户并授权
CREATE USER ‘hive’@’%’ IDENTIFIED BY ‘hive’;
grant all on hive.* to hive@’%’ identified by ‘hive’;
flush privileges;

Leave a Reply

Your email address will not be published. Required fields are marked *