Search form

MySQL

Ubuntu 16.04 Web Server with Apache, PHP, and MySQL

Ubuntu 16.04 LTS has been out for a little while now, and its standard repos offer some nice enhancements over Ubuntu 14: Apache 2.4.18, PHP 7, and MySQL 5.7.12 The process for creating a basic LAMP web server is also streamlined, as a couple of bugs that plagued Ubuntu 14.04 are now eliminated.

To create your LAMP setup:

Install Your Web Server Packages

Ubuntu 16.04 offers current software in its main repos:

Stupid SQL Tricks

Joins

This intends to provide a brief summary of JOIN operations. I'm attempting to follow standard SQL here where possible, thus avoiding, say, Oracle terminology like ANTIJOIN and SEMIJOIN. All SQL databases that I've encountered perform LEFT/RIGHT/INNER JOIN as expected, but others will show some variation. When in doubt, refer to your documentation.

The generic JOIN procedure uses the following syntax:

Reset the MySQL Root Password

So you don't know your MySQL root password but you do have the root password of the server. Here's a quick way to reset your MySQL root password on the command line:

1. Stop MySQL

$ service mysql stop

2. Start MySQL in safe mode without a password

$ mysqld_safe --skip-grant-tables &

3. Log into your database server without a password, and reset the MySQL root password

$ mysql -uroot
mysql> USE mysql;

Back Up MySQL Databases

A simple bash script to back up MySQL databases. This backs up every database on the server to individual gzipped files in the directory you specify so that you can easily restore them separately. If you want it to run everyday, save it with an .sh extension and add it to the crontab of an authorized user.

Subscribe to RSS - MySQL