centos 6.5 下安装mysql 5.7.12,使用官网下载的rpm安装包
下载安装包
这你可以参考:如何从官网下载MySQL最新版本的安装包?
解压安装包
tar -xvf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar
移除已经安装的早期版本
如果不移除的话,会提示有冲突,版本可能有所不同
yum -y remove mysql-libs-5.1.73*
这个可以参考:
CentOS安装mysql*.rpm提示conflicts with file from package的解决办法
CentOS下如何完全卸载MySQL?解决卸载不干净的问题
安装顺序
rpm -ivh mysql-community-common-5.7.12-1.el6.x86_64.rpm rpm -ivh mysql-community-libs-5.7.12-1.el6.x86_64.rpm rpm -ivh mysql-community-client-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpmrpm -ivh mysql-community-devel-5.7.12-1.el6.x86_64.rpm
启动Mysql服务
# service mysqld start初始化 MySQL 数据库: [确定]Installing validate password plugin: [确定]正在启动 mysqld:
修改管理员密码
查看初始管理员密码,下面的命令适用于 RHEL, Oracle Linux, CentOS, and Fedora 平台:
grep 'temporary password' /var/log/mysqld.log
SLES平台使用下面的命令:
grep 'temporary password' /var/log/mysql/mysqld.log
你会发现初始密码超级的复杂,还好我使用XShell,可以复制粘贴
# grep 'temporary password' /var/log/mysqld.log2016-05-14T02:57:24.372528Z 1 [Note] A temporary password is generated for root@localhost: ?sSq8?.IucXV[root@localhost /]# [root@localhost /]# mysql -uroot -p?sSq8?.IucXVmysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or g.Your MySQL connection id is 15Server version: 5.7.12Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.mysql>
注意:这种写法(mysql -uroot -p?sSq8?.IucXV)有时因密码中的特殊字符而不可行,需要先执行(mysql -uroot -p),再根据提示输入密码。
使用下面的命令修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
密码必须包含大写字母小写字母数字和符号,不然会提示:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements(您的密码不符合当前的安全策略要求)
Freepik Mystic
Freepik Mystic 是一款革命性的AI图像生成器,可以直接生成全高清图像
127 查看详情
授权远程登录
参考:CentOS6.5下通过Shell修改MySQL初始密码,开启远程登录,授权远程登录用户
如果不开启远程登录权限,将会遇到类似下面的错误:
在客户机上使用 Navicat for MySQL 远程连接就报10038的错

该问题的案例请参考:mysql远程报10038错误
结束语
注意,使用 yum 安装的和使用rpm安装的有所不同(要么就是不同的版本安装后初始密码的位置不同),我记得之前安装完之后初始密码是保存在 /root/.mysql_sercret 文件中的。
如果你在安装过程中发现、遇到了什么问题,欢迎一起探讨。
相关文章推荐:
mysql 5.7.12 win64手动安装教程步骤(图文)
mysql-5.7.12解压版安装步骤教程
以上就是CentOS 6.5 下安装MySQL 5.7.12详细步骤(图文)的详细内容,更多请关注创想鸟其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/796037.html
微信扫一扫
支付宝扫一扫