Backup a MySQL Database

database-mysql-svgIf you have a MySQL database working behind the scenes on your web site or app then creating and storing backup’s of that database can be vitally important to the operation of your business operations. A MySQL or MariaDB database uses the mysqldump command to create backups.

The mysqldumpcommand outputs a file that contains SQL statements that can be used to rebuild your database, with all of its data. Which could come in handy in the event of an unrecoverable crash or even to just move the database to a new server.

Following the steps in this guide should work on any distribution of Linux that is using MySQL or MariaDB.

Contents

  1. Review the command
  2. Convert to script
  3. Run as nightly cron job
  4. Restore database

Continue reading “Backup a MySQL Database”

Ubuntu 14.04 Web Server

If you are developing websites or web applications one of the first things you are going to want to do is set up a development environment. This post will serve as a howto for setting up an Apache web server on Ubuntu 14.04.

We will be setting up the web server to run several websites so that you can easily separate your projects, and run multiple sites on the same system. This is known as a virtual host Continue reading “Ubuntu 14.04 Web Server”

Using PHP Include

What is PHP Include?

In website development, the include() method is a standard php function that allows a developer to insert files into a webpage.

For example a developer may wish to use an include() as a way to display a navigation bar or a footer across multiple webpages without having to copy and paste the code into each new page. Another distinct advantage here is that you do not have to update each page in your site when making a change. Something that would be incredibly painful and error-prone to attempt by hand on any site with more than just a few pages. Continue reading “Using PHP Include”