centos7搜狐 mysql_Centos7.2.1511YUM安装MySQL5.7.10

//查看系统版本shell > cat /etc/redhat-release

CentOS Linux release 7.2.1511 (Core)

//下载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 'MyNewPass4!';

//简单快速重置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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值