首页 > 数据库 >数据库相关

数据库相关

时间:2023-02-27 17:11:30浏览次数:28  
标签:set grant skip 数据库 相关 password root localhost

解决MySql 1045 Access denied for user ‘root‘@‘localhost‘ (using password: YES)

1.vim /etc/my.cnf文件
在文件末尾添加两行,这样下次登录跳过密码
[mysqld]
skip-grant-tables

重启mysql服务

修改密码
set password for ‘root’@‘localhost’=password(‘12345678’);

如果报:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
输入 flush privileges;刷新

再输入
set password for ‘root’@‘localhost’=password(‘12345678’);

image

标签:set,grant,skip,数据库,相关,password,root,localhost
From: https://www.cnblogs.com/yong-wu/p/17160441.html

相关文章