Reputation: 180
I'm recently applying for a job and the employers need to see my repositories in GitHub. Since they need a database to function, the database must be exported to GitHub.
I've seen a few answers in Stack Overflow but really none of them addresses my issues as they give pretty shallow answers. A comprehensive explanation of it would be ideal.
So my question is : "How do you upload a database in GitHub?" I'm using MySQL Workbench for my project.
Upvotes: 4
Views: 22537
Reputation: 1759
Your best bet is to host your db on the cloud.
If you search for 'MySQL cloud hosting' you will find many cheap or free providers.
You could create a dump of your db and upload the file to GitHub but this isn't a very good idea for multiple reasons:
git clone
very slow.Upvotes: 1
Reputation: 562310
Typically projects on GitHub don't come with a database, but they include code to initialize a database. For example, you can dump the contents of a MySQL database with the mysqldump tool. See https://dev.mysql.com/doc/refman/5.7/en/using-mysqldump.html
The project on GitHub has instructions for loading that data into a database on the user's computer prior to running the application. The user is responsible for installing an instance of MySQL first.
Part of the reason for this is that different users are on different operating systems, and the database software or even the data files might need to be different for different platforms. So it's better to provide the mysqldump file which is in a format that is independent of platform, and can be loaded into a MySQL instance on any operating system.
A second reason is the redistribution license for MySQL Community Edition would obligate you to offer your own GitHub project under a license compatible with the GNU Public License (GPL). The way to work around this is to not distribute MySQL software itself, but distribute only your data, with instructions to reload it into MySQL that is installed by the user.
Upvotes: 4