Remote installation of Stored Procs on MySQL - 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.

Related

How to install or transfer the existing moodle project from ubuntu to Windows (Postgres to MariaDB sql)

My company has two web based project. Our main project (Starbooks) was built using xampp server and Codeigniter framework that installed in our Windows OS and the second project (Frontlearners) was built in Lamp server and moodle (LMS) framework with Postgres database that installed in ubuntu platform.
My goal is to collide this two projects into one by moving the second project (Frontlearners) into the main project (Starbooks) server which uses with xampp server windows platform.
My first attempt is to export the moodle Postgres database using PGAdmin then move the moodle project to the main project server on windows. But I don't know if this is the correct way or not because Postgres and mysql are different database type. I've searching across the internet hoping for the answer or tutorial related to my problem but the results are always fresh installation of moodle which is not related to my problem.
Anybody knows how to solve this problem, a tutorial link, or any article about this situation?
There is a database transfer tool in Moodle.
https://docs.moodle.org/311/en/Database_transfer
So you can convert the PostgreSQL database to MariaDB
First ensure MariaDB is installed on Ubuntu
Turn off cron and put the site in maintenance mode
Then go to Site administration > Development > Experimental > Database migration to convert the database.
Or direct to /admin/tool/dbtransfer/index.php
The tool will check the database structure matches the structures in the install.xml files. If there are any differences, then you will need to update the relevant install.xml file or database table before continuing.
If its a large database, then the UI will probably time out. So use the command line version instead:
php admin/tool/dbtransfer/cli/migrate.php --help
Having said all that, IMHO I would transfer the Windows project to Linux.

Best free tool to take scheduled backup of MySQL from Windows which is installed on Linux server

I have installed MySQL database in VM and planned to take a backup periodically and it can be monitored and executed from Windows Machine.
But when I searched I could not find any full version software to take backup and mysql version is 8
Please advice.
You could use MySQLBackupFTP.
There is a free version that works quite well:
https://mysqlbackupftp.com/features/
Using MySQLBackupFTP you can also connect to your MySQL database through phpMyAdmin if you can't get the TCP/IP access running. That is probably the easiest way.
If you want to have email confirmations about the execution of the back up you would either need to move to a paid version after a while or you simply use GMail or some other email provider. Easy to set up - and using GMail for this (or some other provider of your own) keeps everything free of charge.
If all you need is a regular dump, you can schedule a bash script in CRON to run mysqldump regularly. If you then need access to this dump on your windows machine you can just ftp the dump files across or access them via a samba share.

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

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.

How do I setup a visual MySQL client if I already have MySQL installed in my system?

I have downloaded the MySQL from the following link:
http://dev.mysql.com/downloads/mysql/
Downloaded the version 8.0.0. I have OS X 10.10.5
Now, I suppose I need to configure a visual MySQL client on my laptop to write queries. For that, I have installed sequelpro (sequelpro.com).
I need help on following points:
- Since there are a number of sample databases which one can use to learn SQL, can you please guide me on few such databases. My objective is to learn advanced SQL.
- Also, how do I configure my client (sequelpro) to connect to that database so that I can run queries.
As of now, I am stuck with the following screenshot with no clue what to do next.
Thanks a lot. Screenshot here
Based on the fact you said in the comments you have OSX and you installed mysql manually without phpmyadmin I suggest you download and install mamp.
mamp
1: https://www.mamp.info/en/ is,
MAMP installs a local server environment in a matter of seconds on
your computer. It comes free of charge, and is easily installed. MAMP
will not compromise any existing Apache installation already running
on your system. You can install Apache, PHP and MySQL without starting
a script or having to change any configuration files! Furthermore, if
MAMP is no longer needed, just delete the MAMP folder and everything
returns to its original state (i.e. MAMP does not modify any of the
"normal" system).
Basically it is a fake server that runs on your computer. This will be yours for localhost development. You can use it to serve your localhost php applications, change versions of php and gives you a GUI for mysql which is phpmyadmin.
Once you install mamp
you might need to configure mamp to use the mamp mysql but most likley it will work out of the box. If you do run into any problems make sure you stop the instance of mysql you installed already before running mamp then trying to ran mamp again and it should be using the correct version.

Windows App with mySQL Backend

I am trying to design a database application for my small business. I've created a number of form driven MS Access databases for use before but would like to create a permanent solution in something more advanced & common.
I was thinking of using mySQL for the database and would then program a C# or VB application to be used in Windows. I do not want or need a web based version at this time but the migration to VB.net in the far future may be something I'll look into.
I know I can use a MS Access backend for my windows application without having to install MS Office on any or all the computers the program will be run for.
But here is my question. Is it necessary to install mySQL Server on the PC hosting the database, on all the PCs accessing the database or can I just use the database file as the backend and Visual Studio will have all the necessary tools I need to access it?
If I have to install the server I may just stick with the MS Access database as the needs for an excessive amount of database storage won't ever be an issue.
You'd need to install MySQL server on the Server hosting the database. The clients would then connect via the network. You will however need a driver to access the MySQL-Server with VB.NET on the client machines. A simple DLL-File might be enough, though.
If you are looking for a file-based database solution have a look at SQLite. But you will have to watch out for concurrency issues here.