Changes

Jump to navigation Jump to search
2,206 bytes added ,  06:31, 10 December 2013
Line 1: Line 1:  
==Install mariadb 'alongside' mysql==
 
==Install mariadb 'alongside' mysql==
===Draft notes on mariadb installation===
+
===Raw notes on mariadb installation===
 
  <nowiki>
 
  <nowiki>
 
#####################################################################################
 
#####################################################################################
Line 59: Line 59:  
mysql -e "SELECT VERSION();" --socket=/opt/mariadb-data/mariadb.sock
 
mysql -e "SELECT VERSION();" --socket=/opt/mariadb-data/mariadb.sock
 
</nowiki>
 
</nowiki>
 +
 +
===Gotchas===
 +
====my.cnf====
 +
I have not copied the customization instructions for my.cnf from the mariadb howto page.
 +
 +
Be sure to make all of the changes to my.cnf suggested.
 +
 +
https://mariadb.com/kb/en/installing-mariadb-alongside-mysql/
 +
 +
====/var/run/mariadb====
 +
I could not get mariadb to run until I manually created the folder for the process id file.
 +
<nowiki>mkdir /var/run/mariadb
 +
chown mariadb:maridb /var/run/mariadb</nowiki>
 +
 +
====/etc/init.d/mariadb====
 +
I was unable to make the 'mysqld_save' command line from the howto work.  Where the howto wanted this command:
 +
$bindir/mysqld_safe --defaults-file=/opt/mariadb-data/my.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
 +
 +
I needed to specify the datadir instead of using the "$datadir" variable:
 +
$bindir/mysqld_safe --defaults-file=/opt/mariadb-data/my.cnf --datadir="/opt/mariadb-data" --pid-file="/var/run/mariadb/mariadb.pid" $other_args >/dev/null 2>&1 &
 +
 +
If I use the line suggested in the HOWTO, mariadb never starts (although it reports starting on the command line, it records an error in /opt/mariadb-data/<hostname>.err)
 +
 +
====set mariadb root password====
 +
Since I am managing mariadb using the existing SME mysql client, and since the SME mysql client automatically uses the mysql 'root' password, I chose to set the root password for my mariadb installation to match the mysql root password.
 +
 +
When running the commands below, press <Enter> when prompted for a password (the default mariadb root password is empty):
 +
<nowiki>CONNECT=--socket=/opt/mariadb-data/mariadb.sock
 +
mysql $CONNECT -p < /var/service/mysqld/set.password</nowiki>
 +
 +
Now that your mariadb installation is using your SME Server mysql root password, you can easily verify the versions of mysql and mariadb as described in the howto:
 +
<nowiki>#mysql version
 +
mysql -e "SELECT VERSION();"</nowiki>
 +
 +
<nowiki>#mariadb version
 +
CONNECT=--socket=/opt/mariadb-data/mariadb.sock
 +
mysql -e "SELECT VERSION();" $CONNECT
 +
# OR connect using port 3307
 +
CONNECT="--protocol=TCP --port=3307"
 +
mysql -e "SELECT VERSION();" $CONNECT
 +
# OR spell out the connection on the command line
 +
mysql -e "SELECT VERSION();" --protocol=TCP --port=3307</nowiki>
    
===Backup & Restore===
 
===Backup & Restore===

Navigation menu