centos mysql错误信息处理
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:
*************************************************************************************
最新文章
- 学习笔记:MySQL数据库初步 概念
- Bootstrap系列 -- 40. 导航条二级菜单
- MongoDB 3.0 用户创建
- 小波说雨燕 第三季 构建 swift UI 之 UI组件集-视图集(一)视图共性 学习笔记
- Websocket————错误总结
- [GeekBand] STL与泛型编程(3)
- CentOS5.5上安装git
- Git全解析之远程仓库交互
- sqlite数据库学习
- 使用Spring Cloud和Docker构建微服务架构
- flume 1.7 的配置
- ORA-01843: 无效的月份
- AWS中,如果使用了ELB,出现outofservice
- Spring Boot 正常启动后访问Controller提示404
- 枚举进行位运算 枚举组合z
- python多线程用法及与单线程耗时比较
- MySQL ";replace into"; 的坑以及insert相关操作
- Java程序设计11——GUI设计与事件处理B
- tomcat开发环境配置
- Java中关于Arrays.asList方法的深入学习与理解