A-A+

Centos7.2.1511YUM安装MySQL5.7.12

2016年04月25日 Linux 暂无评论 阅读 4,165 views 次

下载YUM库

shell > wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm

//安装YUM库

shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm

//安装数据库

shell > yum install -y mysql-community-server

//启动MySQL服务

shell > systemctl start mysqld.service

//默认空密码

shell > mysql -uroot -p

//重置root密码

mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword!';

//简单快速重置ROOT数据库密码

最简单的办法,也是最笨的方法,替换mysql数据库中的三个文件

/var/lib/mysql/mysql/ //路径

user.frm、user.MYD、user.MYI //替换这三个文件

附几个错误提示解决办法

1、ERROR 1290 (HY000): The MySQL server is running with the –skip-grant-tables option so it cannot execute this statement.

shell> mysql

mysql> set global read_only=0;

mysql> flush privileges;

mysql> quit

shell> /usr/bin/mysql_secure_installation

2、[ERROR] InnoDB: Cannot create log files because data files are corrupt or the database was not shut down cleanly after creating the data files.

shell> cd /var/lib/mysql

shell> mv ibdata1 ibdata1.bak

3、[ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
innodb_flush_log_at_trx_commit = 2 在此后添加下面内容

innodb_flush_method=normal

4、ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: NO)

shell> /usr/bin/mysql_secure_installation

 

 

关于新版本mysql密码强度的问题:

解决 MySQL 5.7 中 Your password does not satisfy the current policy requirements. 问题

标签:

给我留言