MySQL的安装与.NET WinForms应用程序应用程序、MySQL、NET、WinForms

2023-09-04 10:46:40 作者:混世大魔王

我有一个C#应用程序是使用MySQL的。我在一个测试版点,需要包括我的应用程序,以及MYSQL的安装包。因此,基本上,我需要安装MYSQL和执行从我的.NET中的恢复安装包。

I have a C# application that's utilizes MYSQL. I'm at a beta release point and need an installation package that includes my application, along with MYSQL. So basically, I need to install MYSQL and perform a restore from within my .NET install package.

任何帮助将是很大的AP preciated。

Any help would be greatly appreciated.

推荐答案

您正在试图安装的MySQL的服务器的。这应该是您的第一条线索,什么是错。大部分服务器应用程序被设计成安装在服务器上,而不是在客户端。在此值得注意的一点是,服务器应用程序,如假​​定他们拥有服务器。这是一个巨大的没有没有客户端应用程序。

Step 1: You're doing it wrong

You're attempting to install the mysql server. This should be your first clue that something is wrong. Most server apps are designed to be installed on servers, not on clients. The notable point in this is that server apps like to assume that they 'own' the server. This is a giant no-no for client apps.

现在,我们已经建立了,我们就错了,我们需要选择做什么。我们有两个选择:

Now that we've established that we're doing it wrong, we need to choose what to do. We have 2 options:

从MySQL的切换客场以'客户'的数据库,如SQLite的或SQL Server精简版。 在哈克四处安装服务器应用程序的问题。

我个人会建议切换到SQLite的(或类似)尽快。这是正确的事情做的,你不会有被黑客保持今后几年。

I personally would recommend switching to SQLite (or similar) as soon as possible. It's the "right thing" to do, and you won't have to be maintaining hacks for years to come.

您已经被警告。这里有一些事情你需要做到心中有数,并减轻:

You have been warned. Here are some of the things you will need to be aware of, and mitigate:

MySQL的要安装到Program Files文件\ mysql的。如果用户已经拥有的MySQL安装自己。你会打破一切 您需要告诉你的MySQL版本安装到自定义文件夹。我推荐它作为应用程序的子文件夹 MySQL wants to install into program files\mysql. If the user already has MySQL installed themselves. You'll break everything You'll need to tell your version of MySQL to install into a custom folder. I'd recommend it as a subfolder of your application 您将需要以不同的名字运行服务 您需要更改它的配置,以便将其写入%APPDATA%等

所以,考虑到这一点的所有,我说你最好的选择是set了一个xcopyable MySQL的

So with all this in mind, I'd say your best bet is to set up an xcopyable mysql