- echo "mysql-server mysql-server/root_password select ${mysql_pass}" | debconf-set-selections
- echo "mysql-server mysql-server/root_password_again select ${mysql_pass}" | debconf-set-selections
- ${command_to_install} mysql-server-5.6 mysql-client-core-5.6 python-mysqldb
-
- service ${mysql_service} restart
- sleep 5
-
- if [ -z "$(service ${mysql_service} status | grep "start/running" )" ]; then
- exit_on_error 1 "Mysql service has failed to start"
+ if [[ "$os" == "ubuntu" ]]; then
+ echo "mysql-server mysql-server/root_password select ${mysql_pass}" | debconf-set-selections
+ echo "mysql-server mysql-server/root_password_again select ${mysql_pass}" | debconf-set-selections
+ ${command_to_install} mysql-server-5.6 mysql-client-core-5.6 python-mysqldb
+ if [ -f "/etc/mysql/conf.d/wsrep.cnf" ]; then
+ rm -f /etc/mysql/conf.d/wsrep.cnf
+ fi
+
+ service ${mysql_service} restart
+ sleep 5
+
+ if [ -z "$(service ${mysql_service} status | grep "running" )" ]; then
+ exit_on_error 1 "Mysql service has failed to start"
+ fi
+ else
+ ${command_to_install} install -y http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
+ ${command_to_install} install -y mysql-community-server mysql-community-client
+
+ sleep 5
+ systemctl restart mysql
+ if [ "$?" -ne '0' ]; then
+ exit_on_error 1 "Mysql service has failed to start"
+ fi
+ mysqladmin -u root password ${mysql_pass}