c# - 在 MySql 数据库上搭建脚手架时访问被拒绝
问题描述
我想在我的 .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
谢谢
解决方案
您的密码中可能包含有问题的字符。对我来说是'$'。这在正常使用中很好,但 Scaffold-DbContext 命令会阻塞它。更改您的密码。
推荐阅读
- kubernetes-ingress - 同一后端服务中多个路径的 K8s Ingress 规则
- excel - 如何通过从单元格中获取形状名称来引用形状?
- android - Gradle 错误无法解析 com.github.Binary-Finery:Bungee:master-SNAPSHOT
- c# - 将带有计数的嵌套 SQL 转换为 linQ
- sql - 您如何根据记录总数计算具有统计意义的样本量?(Postgres)
- javascript - 需要以不同的方式格式化对象数组
- java - 带有可选按钮的密码字段以使用 vaadin 显示密码
- python - 使用 Python(正则表达式)将数据仅放在数据框中的方括号中
- ansible - ansible-playbook 可以从标准输入而不是文件中读取吗?
- c# - 使用标签助手调用控制器,包括来自 asp.net core mvc 中搜索栏的数据