Jump to content

[Updated] Simple MySQL Backup & Restore v1.1


Micheck

Recommended Posts


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   8
  • Joined:  11/24/17
  • Last Seen:  

 

Hello guys,

I would like to share one of my simple and small program that i used to backup SQL Database. I am new in making programs as i am learning it in school together with php, so i hope you guys can pardon my noob code. It been created to help my dad and brother to backup their mysql database remotely. Now i would like you guys to try it and give suggestions on the programs.

The field in the programs need to be write manually as that is what my dad and brother requirements.

 

# The program have been updated to v1.1

Spoiler

v1.1.png.5f25c61c97b495805433c7f10f64ce73.png

Download : MySql Tools.rar

  • using .net 4.5
  • slightly change the way backup is save (using only .sql)
  • added restore function with create database option (create database function will only create to a non-exist database)
  • change how the connection been to the MySql server is made

The guides will be updated later.

Please try it and give suggestions for me to improve. You can contact me at [email protected]. If you guys like my work you can buy me a coffee so i can keep my money for my school ^_^

 

p/s : If you would like to take a look or use the source code, it been upload to github. Please comment about the source so i can improve the way i write the code. Thank you.

SimpleMySql Github

 

feature plans :

Quote

 

# add ssh connection to monitor running process such as rathena emulator

# start, restart and kill process

# backup and restore rathena emulator and other stuff via the program

# maybe a simple ftp client will be included.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

V1.0

Spoiler

IT NEED 4.6.2 .net framework, download here

 

Information:

How do i write the arguments ?

Quote

 

Example : server=localhost;user=root;pwd=your-password;database=database-name;

# The argument string will be automatically added with


"charset=utf8;convertzerodatetime=true;"

# End the argument with semicolon.

 

How do i write Save To ?

Quote

 

Example : D:\test\backup-database

# The save file will automatically added with date and time stamp and also .sql . If like the example above, it will be "backup-database-2017-12-05--14-09-28.sql"

 

Screenshots:

Quote

screen1.png.569304b0844b234255cc1f6049133e1e.png

Future plans :

Quote

# Will use .net 4.5

# More user-friendly by avoiding user to write their own arguments and save path

# include restore function

# anything else that i can think and capable of.....

 

Edited by Micheck
update to v1.1
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

I @Micheck thank for sharing.

So I didn't check the dll yet but here my input :

1) Database are sensible information, here you providing an exe to get those information but we don't really see what you doing with it as you only provide binaries. (the only way to check it to decompile or to trust you)

2) I didn't try if this work with mono yet but .net reduce your possible user base. (unless they use this in remote)

3) Could you list the feature of your program ? what make him better then mysqldump ? I'm sure doing this could help you identify new interesting features.
I attached as reference/idea a little script that I had done for my backup. (it's for redmine here but could work for any db)
 

backup_redmine

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   8
  • Joined:  11/24/17
  • Last Seen:  

Hello @Lighta thank you for asking this.. I will try to list out how the programs work. ( please pardon my grammar as english is not my first mother-tounge)

This program is written in C# and use Mysqlbackup.net dll. I know the most common way to backup a MySQL Database is by using MySqlDump.exe and MySQL Workbench. MysqlDump, as i know cannot be use with web application. The hosting providers that host the database for my dad and brother forbid the access to mysqldump. He can only connect through MySQL Workbench. They were using the workbench to backup and download their database.

So when at school i learn about C# and MySQL, and they ask me to help them by just making a small program that will backup the database. So i made this programs get all the parameter preset and they just click the backup button. It is intended to be a remote backup that they can use without accessing the server cpanel or such.

I am working on upgrading the programs like using lower .net framework, more preset statements and a restore function (my dad asked it). This is the link on code-project for the dll that i use for the program (MysqlBackup-NET). You can take a look if you want to get more information on the dll.

This is two set of database that i just made from this. One from my localhost laravel new installation, and the other one is from my remote rAthena database (ragnarok). I have delete the ip on the remote host. This 2 set just want to show you how the save sql is.

Laravel SQL Database : jju-2017-12-06--16-47-59.sql

rAthena Remote Database :jju-remote-2017-12-06--16-49-44.sql

 

This program use dll that been written on top of MySQLdata dll in C#, only that mySQLdata dll used mysqldump to retrieve the database and with this program i just intended to use it for remote backup. I am sharing this thinking it will help some people that may need to backup the database remotely from their local pc. 

Below is the v1.1 that i am doing to upgrade for my dad and brother. I will share it here if any of you guys are interested.

Spoiler

v1.1.thumb.png.ce77167b86aaff2221360597ec48df07.png

 

again i am sorry if this programs is useless or not suitable here.

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

It is suitable, hope you didn't get it wrong.

I was just mentioning that you also have to take into account the context where this will be used. It's sensible stuff and we don't have the same connection /trust then you and your father so that normal we have something to verify / look what you going to do with those stuff. But that just my pov.

Thank for the explanation. so it's meant for remote usage.

 

 

  • Love 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   8
  • Joined:  11/24/17
  • Last Seen:  

Thank you @Lighta for your feedback i appreciated it. It have been update to v1.1

I also include the source code in github if you be kind to take a look into it and comment on my source code. I am new to writing code but i will gladly to hear if there is any comment. Thank You.

future plans :

# add ssh connection to monitor running process such as rathena emulator

# start, restart and kill process

# backup and restore rathena emulator and other stuff via the program

# maybe a simple ftp client will be included.

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  737
  • Reputation:   216
  • Joined:  11/29/11
  • Last Seen:  

Hi @Micheck, just checked your github the code is fine. (I'm not a c# expert anyway).

For little comment you should consider give a real name to your form, that will help you to give them concrete responsibilities etc.. (but this really matter when code start to be big).

Another thing that you could consider is to put your project here : https://rathena.org/board/files/category/130-server-managerseditors/

I don't manage the forum so idk if it's correct in there but I believe it is.

Finally I don't know if you tough about this yet, but generally you want to have have a backup done regularly, like each day/week etc. Cause this is safer to just think of doing it time to time. To do this it would be interesting to have the program as a service. I know you could wrap it with https://nssm.cc/ or others, (you can also do a scheduled task). But I wonder if .net doesn't have something builtin for this. If you do this consider file rolling.
That what I had in my script, dunno if you checked it, anyway it's just a tough.

Good luck and keep the good work.

Edited by Lighta
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   8
  • Joined:  11/24/17
  • Last Seen:  

Hi @Lighta , thank you for the reply and the suggestions.. 

I will upload the program to your proposed section, am still updating the program to add couple of options. Anyways, in my journey of learning c# i have successfully integrated couple of options such as ssh console to remote server, controlling the emulator, adding/editing accounts and much more. Like is said in the post, yes we can used putty to ssh to the server or other ssh console, but i think by having a simple and lightweight console integrated will be fun.

You can find my post here (Control Panel) , if you haven't look at it. I had include this program but with less function to make the program smaller. Yes i also planning to make it capable of doing scheduled task. I will upload the code to github once it is done. 

Thank you again..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...