Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 42 lines (32 sloc) 963 Bytes
#!/bin/bash
# SETUP SQL BOX
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
if [ -v CODIO_HOSTNAME ]
then
echo "Codio box detected"
echo "continuing setup"
else
echo "no Codio box detected"
echo "exiting setup"
exit 0
fi
sudo chown -R codio:codio .
sudo apt update -y
sudo apt upgrade -y
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password p455w0rd'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password p455w0rd'
sudo apt -y install mysql-server mysql-client
echo "PS1='$ '" >> ~/.profile
echo "sudo /etc/init.d/mysql restart" >> ~/.profile
source ~/.profile
FILENAME="/etc/mysql/mysql.conf.d/mysqld.cnf"
SEARCH="127.0.0.1"
REPLACE="0.0.0.0"
sudo sed -i "s/$SEARCH/$REPLACE/gi" $FILENAME
SEARCH="[mysqld]"
REPLACE="[mysqld]\n\nsecure-file-priv=/home/codio/workspace"
sudo sed -i "s/$SEARCH/$REPLACE/gi" $FILENAME
# sudo chown -R mysql:mysql
sudo /etc/init.d/mysql restart