【问题标题】:Acces denied when Scaffolding on MySql database在 MySql 数据库上搭建脚手架时访问被拒绝
【发布时间】:2021-02-04 15:12:11
【问题描述】:

我想在我的 .Net Core 项目上使用实体框架核心来连接到 mysql db。当我尝试搭建脚手架时出现访问被拒绝错误。

Authentication to host 'MyHost.com' for user 'root' using method 'caching_sha2_password' failed with message: Access denied for user 'root'@'MYIP' (using password: YES)

我正在使用这个命令

Scaffold-DbContext "server=MyHost.com;port=9999;user=root;password=Myunbreakablepsw;database=MyDb" MySql.Data.EntityFrameworkCore -OutputDir dbContext -f

谢谢

【问题讨论】:

    标签: c# mysql asp.net-core


    【解决方案1】:

    您的密码中可能包含有问题的字符。对我来说是'$'。这在正常使用中很好,但是 Scaffold-DbContext 命令会阻塞它。更改您的密码。

    【讨论】:

    • 我已经发现了问题,但是我忘记更新我的帖子了。我的问题也与$有关。我只需要用 ` 转义这个字符,它就可以了!谢谢 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-09
    • 1970-01-01
    • 2011-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多