简体   繁体   English

首页> C#>如何设置自己的MySQL数据库到我自己的用户的个人电脑

[英]c# - How can I setup own MySQL database to my users' own pc

I'm working on a program that include user log-in and sign-up. 我正在开发一个包含用户登录和注册的程序。 I'm using MySQL with HeidiSQL app which is free. 我在免费的HeidiSQL应用程序中使用MySQL。 I can use my app in my own pc but when I start it an another pc it doesn't even connect to database. 我可以在自己的PC中使用我的应用程序,但是当我启动另一台PC时,它甚至都没有连接到数据库。 I want to make a setup program which contains my app and mysql installer. 我想制作一个包含我的应用程序和mysql安装程序的安装程序。 I want to setup mysql to my customers' computer so they can all have their own databases and connect to them. 我想将mysql安装到客户的计算机上,以便他们都可以拥有自己的数据库并连接到它们。 How can i achieve this? 我怎样才能做到这一点?

My connection string is: 我的连接字符串是:

public MySqlConnection mysqlbaglan = new MySqlConnection("Server=localhost;Database=x;Uid=root;Pwd='';");

You should rethink your architecture. 您应该重新考虑您的体系结构。 You could try SQLite which is portable and does not need installation as a server. 您可以尝试SQLite,它是可移植的,不需要作为服务器安装。

Check out this relevant SO question . 查看此相关的SO问题

If you want to do that, you should: 如果要这样做,您应该:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM