Tips: Using MySqlConnector + MySqlBackup.NET in CentOS (Linux) #1123
Replies: 2 comments
-
I may have the exact command-line slightly wrong, but you should be able to run something like See https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file for more info. |
Beta Was this translation helpful? Give feedback.
-
Publishing self-contained binary can also be done at Visual Studio GUI Here is the example of how it looks like, there is only 1 single file: Copy the compiled binary to CentOS At the terminal, browse to the folder that contains the self-contained binary, for example:
Next, is to allow execution permission to the file:
Execute the app:
|
Beta Was this translation helpful? Give feedback.
-
I'm one of the main contributor for MySqlBackup.NET project, that works on top of MySqlConnector to perform backup & restore of MySQL databases.
The following explained the idea of using MySqlConnector +MySqlBackup.NET in CentOS (Linux).
The idea is to build the project in .NET Core.
We can test this out with a simple Console App.
Starting by creating a .net core linux project:
Check the project properties, ensure the project is built with .NET Core framework:
Install Nuget Package of MySqlBackup.NET (with MySqlConnector):
Next, is to publish the project for .NET Core (Linux):
In above example, the Linux compiled binaries are located at:
Copy the DLL in above folder and paste it to your CentOS
At the CentOS, make sure that you have installed Dotnet runtime by following command:
For example:
Assume that you have copied your .NET Core DLL files at the following folder:
Then you can test out your app with following command:
Here is the sample source code for your referrence:
ConsoleApp2.zip
Beta Was this translation helpful? Give feedback.
All reactions