phpstudy启动服务之后navicat for mysql连接不上,一直出现1045错误
发布网友
发布时间:2022-03-05 16:32
我来回答
共1个回答
热心网友
时间:2022-03-05 18:01
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');