Skip to content

Commit

Permalink
Switch from MySQL 5.5 to MariaDB 5.5
Browse files Browse the repository at this point in the history
This is the first step in #876 and #949. Switching to MariaDB available
in the official Ubuntu 14.04 repositories is a very safe change and
it paves way to easily upgrade to 10.0 or 10.1 in a later step.
  • Loading branch information
ottok committed Oct 23, 2016
1 parent a1d771f commit b931e73
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ All WordPress admin usernames and passwords for WordPress installations included
__User:__ `admin`
__Password:__ `password`

MySQL Root:
MariaDB/MySQL Root:

__User:__ `root`
__Password:__ `root`

See: [Connecting to MySQL](https://github.com/varying-vagrant-vagrants/vvv/wiki/Connecting-to-MySQL) from your local machine
See: [Connecting to MariaDB/MySQL](https://github.com/varying-vagrant-vagrants/vvv/wiki/Connecting-to-MySQL) from your local machine

#### WordPress Stable
* LOCAL PATH: vagrant-local/www/wordpress-default
Expand All @@ -172,7 +172,7 @@ A bunch of stuff!
1. [WordPress Stable](https://wordpress.org/)
1. [WP-CLI](http://wp-cli.org/) (master branch)
1. [nginx](http://nginx.org/) ([mainline](http://nginx.com/blog/nginx-1-6-1-7-released/) version)
1. [mysql](https://www.mysql.com/) 5.5.x
1. [MariaDB](https://mariadb.org/) 5.5.x (drop-in replacement for MySQL)
1. [php-fpm](http://php-fpm.org/) 7.0.x
1. [memcached](http://memcached.org/)
1. PHP [memcache extension](https://pecl.php.net/package/memcache)
Expand Down
4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Vagrant.configure("2") do |config|
# If a database directory exists in the same directory as your Vagrantfile,
# a mapped directory inside the VM will be created that contains these files.
# This directory is used to maintain default database scripts as well as backed
# up mysql dumps (SQL files) that are to be imported automatically on vagrant up
# up MariaDB/MySQL dumps (SQL files) that are to be imported automatically on vagrant up
config.vm.synced_folder "database/", "/srv/database"

# If the mysql_upgrade_info file from a previous persistent database mapping is detected,
Expand Down Expand Up @@ -281,7 +281,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "post", type: "shell", path: File.join( "provision", "provision-post.sh" )
end

# Always start MySQL on boot, even when not running the full provisioner
# Always start MariaDB/MySQL on boot, even when not running the full provisioner
# (run: "always" support added in 1.6.0)
if vagrant_version >= "1.6.0"
config.vm.provision :shell, inline: "sudo service mysql restart", run: "always"
Expand Down
2 changes: 1 addition & 1 deletion config/mysql-config/my.cnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# The MySQL database server configuration file.
# The MariaDB/MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
Expand Down
6 changes: 3 additions & 3 deletions config/mysql-config/root-my.cnf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Custom MySQL configuration to save the root user's password for both client
# Custom MariaDB/MySQL configuration to save the root user's password for both client
# and mysqladmin access. This allows us to use `mysql -u root` to access
# MySQL rather than having to use a password.
[client]
user = root
password = root

[mysqladmin]
[mysqladmin]
user = root
password = root
password = root
4 changes: 2 additions & 2 deletions database/import-sql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Import provided SQL files in to MySQL.
# Import provided SQL files in to MariaDB/MySQL.
#
# The files in the {vvv-dir}/database/backups/ directory should be created by
# mysqldump or some other export process that generates a full set of SQL commands
Expand All @@ -19,7 +19,7 @@
# Let's begin...

# Move into the newly mapped backups directory, where mysqldump(ed) SQL files are stored
printf "\nStart MySQL Database Import\n"
printf "\nStart MariaDB Database Import\n"
cd /srv/database/backups/

# Parse through each file in the directory and use the file name to
Expand Down
18 changes: 9 additions & 9 deletions provision/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ apt_package_check_list=(
# memcached is made available for object caching
memcached

# mysql is the default database
mysql-server
# mariadb (drop-in replacement on mysql) is the default database
mariadb-server

# other packages that come in handy
imagemagick
Expand Down Expand Up @@ -217,13 +217,13 @@ package_check() {
package_install() {
package_check

# MySQL
# MariaDB/MySQL
#
# Use debconf-set-selections to specify the default password for the root MySQL
# account. This runs on every provision, even if MySQL has been installed. If
# MySQL is already installed, it will not affect anything.
echo mysql-server mysql-server/root_password password "root" | debconf-set-selections
echo mysql-server mysql-server/root_password_again password "root" | debconf-set-selections
# Use debconf-set-selections to specify the default password for the root MariaDB
# account. This runs on every provision, even if MariaDB has been installed. If
# MariaDB is already installed, it will not affect anything.
echo mariadb-server-5.5 mysql-server/root_password password "root" | debconf-set-selections
echo mariadb-server-5.5 mysql-server/root_password_again password "root" | debconf-set-selections

# Postfix
#
Expand Down Expand Up @@ -458,7 +458,7 @@ phpfpm_setup() {
}

mysql_setup() {
# If MySQL is installed, go through the various imports and service tasks.
# If MariaDB/MySQL is installed, go through the various imports and service tasks.
local exists_mysql

exists_mysql="$(service mysql status)"
Expand Down

0 comments on commit b931e73

Please sign in to comment.