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. golang结构体排序 - 根据下载时间重命名本地文件

    喜M拉Y下载音频到手机,使用ximalaya.exe 解密[.x2m]为[.m4a]根据文件下载创建时间,顺序重命名文件,方便后续播放. 源码如下:package main import ( &quo ...

  2. 【整理】用JSON-server模拟REST API

    用JSON-server模拟REST API https://www.cnblogs.com/ys-wuhan/p/6387791.html

  3. 初识WEBGL

    WEBGL (全写Web Graphics Library)是一种3D绘图协议,这种绘图技术标准允许把JavaScript和OpenGL ES 2.0结合在一起,通过增加OpenGL ES 2.0的一 ...

  4. Mathematics-基础:斐波那契数列

    f(1)=1 f(2)=1 f(n)=f(n-1)+f(n-2) n>2

  5. PHP20 PHP面向对象辅助

    学习要点 常用函数 命名空间 类的自动加载 常用函数 class_exists 作用:检查类是否已定义 语法格式: bool class_exists ( string $class_name [, ...

  6. OpenCV2:第六章 图像几何变换

    一.简介 图像的几何变换有距离变换 坐标映射 平移  镜像 旋转  缩放  仿射变换等 二.重映射 把一张图像重新排列像素,比如倒置 CV_EXPORTS_W void remap( InputArr ...

  7. OpenCV2:总结篇 工具方法函数

    一.简介 OpenCV提供了一些工具方法函数来辅助完成图像运算 二.时间相关 1.getTickCount()和getTickFrequency() double tTime; tTime = (do ...

  8. 关于python字符串拼接的几种方法

    当时看完python的基本语法后 给朋友写了个美元概率换算 写完后拼接结果时候 发现压根不知道python怎么拼接字符串 看了些资料自己做了个总结 首先就是和JavaScript一样的拼接方式 nam ...

  9. python中unicode, hex, bin之间的转换

    python中unicode, hex, bin之间的转换 背景 在smb中有个feature change notify, 需要改动文件权限dacl,然后确认是否有收到notify.一直得不到这个d ...

  10. 【BZOJ 3289】 Mato的文件管理(离线算法莫队)

    Description Mato同学从各路神犇以各种方式(你们懂的)收集了许多资料,这些资料一共有n份,每份有一个大小和一个编号.为了防止他人偷拷,这些资料都是加密过的,只能用Mato自己写的程序才能 ...