Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql 的建表语句还有吗 #33

Open
Qintai opened this issue Jul 5, 2024 · 4 comments
Open

Mysql 的建表语句还有吗 #33

Qintai opened this issue Jul 5, 2024 · 4 comments

Comments

@Qintai
Copy link

Qintai commented Jul 5, 2024

Mysql 的建表语句还有吗,本地没装 pg sql

@ldqk
Copy link
Owner

ldqk commented Jul 6, 2024

你把程序的驱动改成MySQL的,然后跑一下就自动生成表结构了

@Qintai
Copy link
Author

Qintai commented Jul 6, 2024

image
这里写死了 pgsql。修改程序驱动是改这里嘛,加个UseMySQL

 services.AddDbContext<LoggerDbContext>(opt => opt.UseNpgsql(AppConfig.ConnString)); //配置数据库

1 similar comment
@Qintai
Copy link
Author

Qintai commented Jul 6, 2024

image
这里写死了 pgsql。修改程序驱动是改这里嘛,加个UseMySQL

 services.AddDbContext<LoggerDbContext>(opt => opt.UseNpgsql(AppConfig.ConnString)); //配置数据库

@ldqk
Copy link
Owner

ldqk commented Jul 6, 2024

是的,你引用MySQL的驱动改成UseMySQL,连接字符串也改成MySQL的就好了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants