Should I install MariaDB to my git repo, or locally / individually to all development computers? - mysql

I am starting work on a website that will use MariaDB for storing information (no sensitive information), and would like to keep everything in my git repo.
Originally, I planned on installing MariaDB to the separate computers that I plan to develop on (my desktop and laptop), but decided that it may be easier to store all of MariaDB (the program and the databases) in the git repo, so that one would just need to clone the repo and run MariaDB from the repo just like they would run Node, but I have not found any information on how to do this.
My questions are (1) should I install MariaDB and its databases to my git repo, instead of installing MariaDB in /usr, and the database in /var/lib/mysql, and (2) how would one do that?

Instead of attempting to put a mariadb runtime environment inside your version control, consider using docker to describe how to configure an appropriate mariaDB installation. I use makefiles atop that to contain the commands I use to build and run the docker but you coould just as easily use a shell script. Finally, provide a dataabase load script that loads your test database from a text file within the repo.
using docker to describe runtime environments for your application and dependencies is awesome. It strikes a great balance between having an incomplete git repo, and having to put binaries and database data in your version control. You wouldn't want to track changes to the underlying maria db files, anyway, so best not to commit them. You can build the docker containers you need on every workstation you use without much trouble, your automation around creating them provides a mechanism to ensure consistency, and by loading a database with the correct test data every time you develop your app, you'll have a better development process and less schema and data related changes. It works great, I do nothing but docker driven development these days.

Related

How to automate migration script generation for a couple of microservice databases in MariaDB?

We use MariaDB docker for local development and since we're using microservice architecture, we have many databases. For example for a typical application, we might have 20 databases.
And we also use MariaDB docker for the production environment.
I'm trying to make a GitHub action to automate database migration script generation. This is what the action does:
Runs each night, or on-demand
Pull our code from GitHub
Pull MariaDB from docker hub
Builds our databases in the docker
Compares those databases, to our production databases // this part I'm stuck in
I'm stuck in comapring databases via command line. in SQL Server, there is this SqlPackage.exe that is a free command-line utility that can be used to automate migration script generation in CI/CD pipelines.
How can I achieve something similar for MariaDB?
I want to be able to create migration scripts from command-line, inside GitHub actions.

Switching between developer environment Windows/Ubuntu

I have a PC with a dual boot: Win 8.1 and Ubuntu 14.04 and I have some project in PHP & mySql and sometimes I need to develop under ubuntu (but I usually prefer Windows) but I need to share the files and db's between the two os.
In share I mean if I change some php files or rows in the database that must be visible in both OS. Is it possible?
Extra thing: The most beautiful thing would be if I could get the mercurial in this thing.
Liquibase for proper versioning of DB-changes in both OS
Mercurial in both OS
External Mercurial hosting (Bitbucket?) for intermediate repository and backup
Good editor or IDE, in which you can configure EOL-style (in order to have same EOL in Windows and Linux, different by default)
Code in active OS, commit changes to local Mercurial, push to remote.
Before starting work in another OS - pull collected changes from remote

Developing OpenShift cartridges that need large binaries

When developing an OpenShift cartridge, what is the standard way to handle large binaries that it will need? Let's say a 100 MB file. Searching around the web I saw a couple cartridges that had their required binaries in the git repository, but I thought that was generally considered to be a bad idea from a git perspective.
You can either add it to your repo as you mentioned or host the file elsewhere and wget it part of your install scripts.

How to setup a box and 3 machines as a web development environment for a small team

Extended title: How to setup a box with (Windows7 + Apache + VisualSVN + MySQL + PHP) and 3 machines with (MacOs/Windows7) and Dreamweaver CS5 as a web development environment for a small team
These are my thoughts. Please forgive my ignorance, I still don´t have completly clear all the concepts.
1. I need to setup a web development environment for a small team of 3 web developers. The staging and live environments will be in a remote server under an external hosting company (probably Amazon).
2. Our first project is a blog with Wordpress
3. I've installed XAMPP in the box and can be accessed like this (http://dev.company.com/xampp)
4. I've installed Wordpress and can be accessed like this (http://dev.company.com/blog)
5. I've installed VisualSVN in the box and can be accessed like this (http://dev.company.com:8080/svn)
6. I don´t know how to import files for the first time to my repositories in the box (c:/repositories/blog)
7. VisualSVN includes Apache. I don´t know if I should turn off the Apache of XAMPP or if should install another version of VisualSVN without Apache
8. I don't know if I should keep my repositories at C:\repositories or c:\xampp\htdocs.
9. I've read something about hooks? to copy the files from the repositories to the htdocs? Can anybody explain this process?
10. Would it be a good option to keep all the files always in the box? or it is a better option to check out the files to the machines?
11. When setting up Dreamweaver to connect to the SVN Server, do I have to point to the trunk, branch or the name of the repository? Do I have to setup a different connection for each branch?
12. How can we include images and PSD's in the repositories?
When we start a new project we usually just checkout files on clients and commit the changes to the server when finished editing. This way people can just edit files on their own machine (without other users slowing stuff down).
Can't you just do a Linux install for the webserver (CentOS or something like that?). Windows 7 seems so heavy / unfitted for webdevelopment server.
We usually keep the repo out of the webroot.
XAMPP really???
Just my two cents...
It's strongly not recommended to use Apache HTTP server bundled to VisualSVN Server for anything else than Subversion server. So you have to install VisualSVN Server and XAMPP.
Just keep repositories in C:\Repositories. If you move them to htdocs all repository will be accessed for everyone who have access to XAMPP.
Common practice is to checkout working copy to htdocs folder, configure permissions to deny access to .svn and then run svn update in post-commit hook in VisualSVN Server.

Remote installation of Stored Procs on MySQL

I'm just setting up the live environment for my new project. Unlike my dev and testing systems, the live environment consists of a web server (Win 2003) and a separate DB server (MYSQL).
My installation process for each release of the software is nicely scripted, giving me full rollback options etc.
However, I can't work out how to install my stored procedures within that process. I can't run a MYSQL command line because MYSQL isn't installed on the web server, it only accesses the DB via ODBC.
Is there a means by which I can run MYSQL commands on the web server, via ODBC from a command line? I really want to keep it all together so I can run "Install v123" and everything whizzes off and gets installed in one go.
There may be a more elegant solution but: I had a very similar problem a number of years ago, and I eventually just wrote a little stand alone program to run my scripts at the end of the install.
Another common option is to have them run as part of a configuration utility/page the user goes to after setup, but I'm assuming you want to keep this as a 1 step installation.