flask项目部署时,Mysql在ubuntu18中 . Access denied for user 'root'@'localhost' (using password: YES)
2019-07-04 19:35
811 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_44704210/article/details/94646323
密码问题,需要重置密码:
1.
cd /etc/mysql/mysql.conf.d/ #找到文件所在目录,也有直接存储在/etc的:sudo vim /etc/my.cnf
sudo vim mysqld.cnf
2.打开配置文件后,寻找到[mysqld]关键字,在其下方任意一行添加“skip-grant-tables”命令,用于跳过密码验证:
3.sudo service mysql restart #重启mysql使配置生效
4.重启后直接输入mysql -uroot -p就能进入mysql,无须输入密码;然后输入以下语句:
use mysql;
update user set authentication_string=password(‘root’) where user=‘root’;
flush privileges; #让权限生效,也就是新密码生效
exit;
5.把配置里的skip-grant-tables给删除或者注释
除了重设密码语句不一样以外,大部分参考于:
https://blog.csdn.net/weixin_42681866/article/details/83867802
相关文章推荐
- Ubuntu下MySQL的“ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)”
- Ubuntu上使用jsp去连接mysql的时候踢提示Access denied for user 'root'@'localhost' (using password: YES)的解决办法!!!
- Ubuntu mysql 的Access denied for user 'root'@'localhost' (using password: YES错误解决方法
- mysql启动问题access denied for user 'root'@'localhost'(using password:YES)
- MySQL for mac 连接报错:Access denied for user 'root'@'localhost' (using password: YES)
- 项目经验分享——完美解决Access denied for user 'root'@'localhost' (using password: YES)
- MySql 出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES).问题解决方案
- MySQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)or“MySQL”修改密码............
- MYSQL登陆异常---Access denied for user 'root'@'localhost' (using password:YES)
- win10下MySQL 8.0登录Access denied for user‘root’@‘localhost’ (using password: YES)问题的解决方法
- linux安装MySQL出现ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- MYSQL问题解决方案:Access denied for user 'root'@'localhost' (using password:YES)
- mysql报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- 【MYSQL】ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
- mysql启动问题access denied for user 'root'@'localhost'(using password:YES)
- JSP连接MySQL时出现--错误:Access denied for user 'root'@'localhost' (using password: YES)'解决方案
- 登陆MySQL出现error:‘Access denied for user 'root'@localhost (using password :YES)'解决方法
- mysql错误:Error: Access denied for user 'root'@'localhost' (using password: YES)解决办法
- ubuntu下mysql5.7的'Access denied for user 'root'@'localhost' (using password: YES)'错误
- Mysql-(Mysql5.7及以上版本)Access denied for user 'root'@'localhost' (using password:YES) 解决方案