Navicat for MySQL连接MYSQL出错,错误代码1045

2024-12-19 11:53:41
推荐回答(3个)
回答1:

mysqladmin -h hostname flush-privileges
use mysql; update user set password =password('yourpass') where user='root'
出现无法连接数据库的话,命令行用root用户登陆,敲下面命令:
SET PASSWORD FOR sns@'localhost'=OLD_PASSWORD('sns');
然后刷新mysql权限
FLUSH PRIVILEGES;
导入数据的方法 mysql -u name -p --default-character-set=utf8 databasename < path\*.sql

create database name character set utf8;
如果出现#1251 - Client does not support authentication protocol requested by server;的错误:
解决办法:先用root登录MYSQL服务器,执行

mysql>set password for user1@"localhost"=old_password('yourPassword');

回答2:

右键连接,看看密码那一项是不是写错了

回答3:

mysqladmin -h hostname flush-privileges
use mysql; update user set password =password('yourpass') where user='root'
出现无法连接数据库的话,命令行用root用户登陆,敲下面命令:
SET PASSWORD FOR sns@'localhost'=OLD_PASSWORD('sns');
然后刷新mysql权限
FLUSH PRIVILEGES;
导入数据的方法 mysql -u name -p --default-character-set=utf8 databasename < path\*.sql

create database name character set utf8;
如果出现#1251 - Client does not support authentication protocol requested by server;的错误:
解决办法:先用root登录MYSQL服务器,执行

mysql>set password for user1@"localhost"=old_password('yourPassword');