008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)
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';
008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章
- 连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输 ...
- MySQL登录报错"Access denied for user 'root'@'localhost' (using password: YES)"
最近登录MySQL时候总报错: # mysql -uroot -p Enter password: ERROR (): Access denied for user 'root'@'localhost ...
- linux下mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
最近登录某台服务器的mysql时候总报错: Access[root@log01 ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Acc ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...
- 连接数据库报错Access denied for user 'root'@'localhost' (using password:YES)
报错信息为:pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using pa ...
- 运行JavaWeb项目报错Access denied for user 'root'@'localhost' (using password: YES)
问题重现:(以下讨论范围仅限Windows环境): C:\AppServ\MySQL> mysql -u root -p Enter password: ERROR 1045 (28000): ...
- 最新 mysql登录报错“Access denied for user 'root'@'localhost' (using password: NO”的处理方法
1.关闭正在运行的MySQL.2.打开DOS窗口,转到mysql\bin目录.3.输入mysqld --skip-grant-tables回车.如果没有出现提示信息,那就对了.(正常的情况是光标闪烁没 ...
- MySQL5.7.20报错Access denied for user 'root'@'localhost' (using password: NO)
在centos6.8上源码安装了MySQL5.7.20,进入mysql的时候报错如下: 解决办法如下: 在mysql的配置文件内加入: vim /etc/my.cnf skip-grant-tabl ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法
使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 文件内容: [client]host = localhostuser = debian-sys-maint ...
随机推荐
- vbs剪切Excel某一行
set oExcel = CreateObject( "Excel.Application" ) '创建oExcel对象 oExcel.Visible = false '4) 打开 ...
- postgresql —— 数组类型
创建数组 CREATE TABLE sal_emp ( name text, pay_by_quarter integer[] --还可以定义为integer[4]或integer ARRAY[4] ...
- drf框架 - 过滤组件 | 分页组件 | 过滤器插件
drf框架 接口过滤条件 群查接口各种筛选组件数据准备 models.py class Car(models.Model): name = models.CharField(max_length=16 ...
- Chrome抓包小技巧
1.抓包时如果有页面跳转,记得把preserve log这个选项勾上
- (尚016)Vue指令(11个自带指令+自定义指令)
1.Vue常用指令 1)v:text:更新元素的 textContent 2)v-html:更新元素的 innerHTML 3)v-if:如果为true,当前标签才会输出到页面 4)v-else:如果 ...
- PHP-FPM参数详情
pid = run/php-fpm.pid #pid设置,默认在安装目录中的var/run/php-fpm.pid,建议开启 error_log = log/php-fpm.log #错误日志,默认在 ...
- Poj 2018 Best Cow Fences(分数规划+DP&&斜率优化)
Best Cow Fences Time Limit: 1000MS Memory Limit: 30000K Description Farmer John's farm consists of a ...
- fhq treap ------ luogu P3369 【模板】普通平衡树(Treap/SBT)
二次联通门 : LibreOJ #104. 普通平衡树 #include <cstdio> #include <iostream> #include <algorithm ...
- AtCoder Grand Contest 008题解
传送门 \(A\) 分类讨论就行了 然而我竟然有一种讨论不动的感觉 int x,y; inline int min(R int x,R int y){return x<y?x:y;} inlin ...
- 《挑战30天C++入门极限》对C++递增(增量)运算符重载的思考
对C++递增(增量)运算符重载的思考 在前面的章节中我们已经接触过递增运算符的重载,那时候我们并没有区分前递增与后递增的差别,在通常情况下我们是分别不出++a与a++的差别的,但的确他们直接是 ...