您好,欢迎访问一九零五行业门户网

CentOS 6.5 下安装MySQL 5.7.12详细步骤(图文)

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.rpm rpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpm rpm -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.log 2016-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?.iucxv mysql: [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 15 server version: 5.7.12 copyright (c) 2000, 2016, oracle and/or its affiliates. all rights reserved. oracle is a registered trademark of oracle corporation and/or its affiliates. other names may be trademarks of their respective owners. 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(您的密码不符合当前的安全策略要求)
授权远程登录参考: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详细步骤(图文)的详细内容。
其它类似信息

推荐信息