mysql_secure_installation

提示错误:
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

解决方法:
#1.停止mysql数据库

/etc/init.d/mysqld stop

#2.执行如下命令

mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

#3.使用root登录mysql数据库

mysql -u root mysql

#4.更新root密码

mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';

#最新版MySQL请采用如下SQL:

mysql> UPDATE user SET authentication_string=PASSWORD('newpassword') where USER='root';

#5.刷新权限

mysql> FLUSH PRIVILEGES;

#6.退出mysql

mysql> quit

#7.重启mysql

/etc/init.d/mysqld restart

#8.使用root用户重新登录mysql

mysql -uroot -p

Enter password:
*************************************************************************************

centos mysql错误信息处理的更多相关文章

  1. 搭建阿里云 centos mysql tomcat jdk

    [toc] 阿里云使用centos 登录 http://www.aliyun.com/ 点击登录 进入控制 https://home.console.aliyun.com/ 云服务器 运行中 把ip输 ...

  2. mysql 错误信息

    1 连接MySQL错误:Can't connect to MySQL server (10060) link:>>>  http://blog.csdn.net/testcs_dn/ ...

  3. centos mysql 实战 第一节课 安全加固 mysql安装

    centos mysql  实战  第一节课   安全加固  mysql安装 percona名字的由来=consultation 顾问+performance 性能=per  con  a mysql ...

  4. MySQL错误ERROR 2002 (HY000): Can't connect to local MySQL server

    From: http://www.jb51.net/article/56952.htm 这篇文章主要介绍了MySQL错误ERROR 2002 (HY000): Can't connect to loc ...

  5. centos MySQL主从配置 ntsysv chkconfig setup命令 配置MySQL 主从 子shell MySQL备份 kill命令 pid文件 discuz!论坛数据库读写分离 双主搭建 mysql.history 第二十九节课

    centos  MySQL主从配置 ntsysv   chkconfig  setup命令  配置MySQL 主从 子shell  MySQL备份  kill命令  pid文件  discuz!论坛数 ...

  6. centos:mysql主从同步配置(2018)

    centos:mysql主从同步配置(2018) https://blog.csdn.net/liubo_2016/article/details/82379115 主服务器:10.1.1.144; ...

  7. MySQL错误日志总结

    MySQL错误日志是记录MySQL 运行过程中较为严重的警告和错误信息,以及MySQL每次启动和关闭的详细信息.错误日志的命名通常为hostname.err.其中,hostname表示服务器主机名. ...

  8. Mysql错误:Ignoring query to other database解决方法

    Mysql错误:Ignoring query to other database解决方法 今天登陆mysql show databases出现Ignoring query to other datab ...

  9. MySQL错误:The user specified as a definer (XXX@XXX) does not exist

    今天由于更换服务器,重新再本地备份了数据库,试运行程序报错,如下: MySQL错误:The user specified as a definer (XXX@XXX) does not exist 意 ...

随机推荐

  1. 使用snapshot继续训练网络

    注意:snapshots和weights不能同时使用 用预训练模型进行finetune是以下命令: ./build/tools/caffe train --solver=examples/XXX/le ...

  2. Session/EntityManager is closed

    Hinbernate操作数据库必须要开启事务, 但是在添加事务的时候遇到这个问题也是郁闷, 说Session被关闭了, 而这个Session又是必须的. 关键是我并没有关闭, 也找不到是哪里被关闭了的 ...

  3. AspNetCore容器化(Docker)部署(一) —— 入门

    一.docker注册安装 Windows Docker Desktop https://www.docker.com/products/docker-desktop Linux Docker CE h ...

  4. 关于Java的三种普通排序

    首先要知道是哪几种排序 这里我们所说的是 冒泡排序,选择排序以及插入排序 然后要理解大概的排序速度 : 插入<选择<冒泡 下面是代码 大家可以拷贝自己在java环境里运行运行! publi ...

  5. 阿里云ECS搭建node/mongodb开发环境及部署

    一.前端的er在window或mac上安装开发环境应该再清楚不过了.但在服务器上安装还是有点不同的,毕竟是 centOS,从此不得不走上用命令操作…… 二.前期准备 1.首先,我们去阿里云网站阿里云服 ...

  6. Vue之数据绑定

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. HDU4300 Clairewd’s message(拓展kmp)

    Problem Description Clairewd is a member of FBI. After several years concealing in BUPT, she interce ...

  8. 使用iframe引入公共模块

    新建一个公共文件head.html <!DOCTYPE html><html lang="en"><head> <meta charset ...

  9. mac rar文件解压缩

    在下载文件时经常遇到RAR格式的压缩文件, 之前从APP Store下载了免费的解压软件, 但是总觉着不好用, 广告信息很多. 好用的软件都要花钱, 所以找到了命令行解决的办法. 步骤如下: 首先需要 ...

  10. C语言程序内存分布

     一个进程的数据在内存中的布局如下图: bss段(bss segment):可读可写不可执行,通常用来存放程序中未初始化的全局变量.bss是英文Block Started by Symbol的简称.b ...