mysql 5.7安装文档

1)     下载安装包
#wget https://cdn.mysql.com//archives/mysql-5.7/mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar 
2)      解压安装包
# tar -xvf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar//解压后文件列表:mysql-community-embedded-devel-5.7.18-1.el7.x86_64.rpmmysql-community-devel-5.7.18-1.el7.x86_64.rpmmysql-community-client-5.7.18-1.el7.x86_64.rpmmysql-community-common-5.7.18-1.el7.x86_64.rpmmysql-community-embedded-5.7.18-1.el7.x86_64.rpmmysql-community-embedded-compat-5.7.18-1.el7.x86_64.rpmmysql-community-libs-5.7.18-1.el7.x86_64.rpmmysql-community-server-minimal-5.7.18-1.el7.x86_64.rpmmysql-community-test-5.7.18-1.el7.x86_64.rpmmysql-community-minimal-debuginfo-5.7.18-1.el7.x86_64.rpmmysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm 
3)      按次序安装
按common–>libs–>client–>server的顺序安装:
# rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm# rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm# rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm# rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm# rpm -ivh mysql-community-devel-5.7.18-1.el7.x86_64.rpm //安装下面包,否则Hue安装报连接错误# rpm -ivh  mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm 
4)      启动数据库
# systemctl start mysqld 查看状态: # systemctl status mysqld 
5)      修改MySQL初始密码
1、先修改配置文件/etc/my.cnf令MySQL跳过登录时的权限检验,在[mysqld]下加入一行:skip-grant-tables2、重启MySQL# systemctl restart mysqld3、免密码登录MySQL。#mysql4、mysql客户端执行如下命令,修改root密码mysql>  use mysql;mysql> UPDATE user SET authentication_string = password('root') WHERE host = 'localhost' AND user = 'root';mysql> select host,user, authentication_string, password_expired from user; mysql> update user set password_expired='N' where password_expired='Y' //密码不过期mysql> update user set host='%' where user='root' and host='localhost'; //远程可访问mysql> flush privileges; //刷新mysql> exit;//退出5、修改配置文件/etc/my.cnf删除此前新增那一行skip-grant-tables,并重启MySQL(这一步非常重要,不执行可能导致严重的安全问题)# systemctl restart mysqld 

猜你喜欢

转载自blog.csdn.net/wyqwilliam/article/details/81162930
今日推荐