Red Hat 6.4下安装mysql5.7.23

 

 

linux版本为:Red Hat Enterprise Linux Server release 6.4

wget https://repo.mysql.com//mysql57-community-release-el6-10.noarch.rpm

rpm -ivh mysql57-community-release-el6-10.noarch.rpm

yum install -y mysql-community-server

Dependencies Resolved

==================================================================================================================
 Package                           Arch              Version                   Repository                    Size
==================================================================================================================
Installing:
 mysql-community-server            x86_64            5.7.23-1.el6              mysql57-community            153 M
Installing for dependencies:
 mysql-community-client            x86_64            5.7.23-1.el6              mysql57-community             23 M
 mysql-community-common            x86_64            5.7.23-1.el6              mysql57-community            332 k
 mysql-community-libs              x86_64            5.7.23-1.el6              mysql57-community            2.1 M

Transaction Summary
==================================================================================================================
Install       4 Package(s)

Total download size: 178 M


 

启动时显示初始化失败:

[root@redhat2 ~]# service mysqld start
初始化 MySQL 数据库:                                      [失败]

 

mysql版本为:5.7.23

查看报错日志:

2018-09-02T04:16:07.681689Z 1 [ERROR] Failed to open the bootstrap file /var/lib/mysql-files/install-validate-password-plugin.Gkohex.sql
2018-09-02T04:16:07.681704Z 1 [ERROR] 1105  Bootstrap file error, return code (0). Nearest query: 'LSE SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM `', in_db, '`.`', in_table, '`'); PREPARE stmt_select FROM @sys.tmp.table_exists.SQL; IF (NOT v_error) THEN DEALLOCATE PREPARE stmt_select; SET out_exists = 'TEMPORARY'; END IF; END IF; END;
'
2018-09-02T04:16:07.681866Z 0 [ERROR] Aborting
 

################################

两种解决方式:

方法1.vi /tmp/mysql-init.txt

UPDATE mysql.user SET authentication_string = PASSWORD('p@ssw0rd')
WHERE User = 'root' AND Host = 'localhost';
FLUSH PRIVILEGES;

通过 mysqld_safe启动:

mysqld_safe --init-file=/tmp/mysql-init.txt

重启检查密码设置是否生效:

service mysqld stop
service mysqld start
chkconfig mysqld on

Test root's password with mysql CLI:

mysql -u root -p

 

方法2:mysql安全模式 通过skip-grant-tables跳过设置,启动后再设置密码:

killall -TERM mysqld

mysqld_safe --skip-grant-tables &

mysql> use mysql

update user set authentication_string=PASSWORD('123456') where user='root';

mysql> FLUSH PRIVILEGES;

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值