[数据库]mysql MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)
[数据库]mysql配置连接拒绝无权限解决方法
https://www.cnblogs.com/bjlhx/p/11395992.html
1、新安装的mysql报错
MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)
解决方案
1、先停掉原来的服务
/etc/init.d/mysqld stop
2、使用安全模式登陆,跳过密码验证
mysqld_safe --user=mysql --skip-grant-tables --skip-networking&
或者上述两步可以使用如下操作
在mysql的配置文件内加入:
vim /etc/my.cnf
skip-grant-tables
保存并重启mysql服务
3、进入mysql,修改密码:
mysql> use mysql;
mysql> update user set password=password("你的新密码") where user="root";
mysql> flush privileges;
mysql> quit
到此root账户就重置了密码,
注意:如果使用配置文件了,需要删除etc/my.cnf中,刚添加的那行内容,重启mysql就好了
更新密码出错
mysql> update user set password=password("你的新密码") where user="root";
报错:ERROR 1054 (42S22): Unknown column 'password' in 'field list'
解决措施如下:
mysql>desc user;
发现在Field列中没有password,此时我们需要这样重置密码:
mysql>update user set authentication_string=password('123456') where user='root';
原文地址:https://www.cnblogs.com/tiaotiaoxia/p/11398564.html
- MySQL 教程
- MySQL 安装
- MySQL 管理与配置
- MySQL PHP 语法
- MySQL 连接
- MySQL 创建数据库
- MySQL 删除数据库
- MySQL 选择数据库
- MySQL 数据类型
- MySQL 创建数据表
- MySQL 删除数据表
- MySQL 插入数据
- MySQL 查询数据
- MySQL where 子句
- MySQL UPDATE 查询
- MySQL DELETE 语句
- MySQL LIKE 子句
- mysql order by
- Mysql Join的使用
- MySQL NULL 值处理
- MySQL 正则表达式
- MySQL 事务
- MySQL ALTER命令
- MySQL 索引
- MySQL 临时表
- MySQL 复制表
- 查看MySQL 元数据
- MySQL 序列 AUTO_INCREMENT
- MySQL 处理重复数据
- MySQL 及 SQL 注入
- MySQL 导出数据
- MySQL 导入数据
- MYSQL 函数大全
- MySQL Group By 实例讲解
- MySQL Max()函数实例讲解
- mysql count函数实例
- MYSQL UNION和UNION ALL实例
- MySQL IN 用法
- MySQL between and 实例讲解
- PAT (Basic Level) Practice (中文)1047 编程团体赛
- 聊聊AWK命令的那些事
- Flink实战-定时器实现已完成订单自动五星好评
- 树状数组-HDU3015 Disharmony Trees
- 放弃fastjson,拥抱Jackson
- Spring入门
- 贪心-HDU1789 Doing Homework again(活动安排问题)
- flink实战-实时计算平台通过api停止流任务
- JAVA初级岗面试知识点——基础篇
- flink实战-flink streaming sql 初体验
- flink实战教程-使用set实时计算当天网站uv
- 贪心-HDU3348 coins(钱币问题)
- 归并排序详解 -HDU4911 Inversion(逆序对)
- 数据结构与算法——稀疏数组
- Maven安装配置详细教程