Initialize mysql.
Created
March 19, 2012 07:06
-
-
Save sowawa/2100153 to your computer and use it in GitHub Desktop.
Mysql initialize on rackhub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd | |
# stop mysql | |
sudo /usr/local/mysql/mysql.server stop | |
MYSQL_DIR=/usr/local/mysql-5.6.5-m8 | |
MYSQL_DATA_DIR=$MYSQL_DIR/data | |
sudo rm -rf $MYSQL_DATA_DIR | |
sudo mkdir $MYSQL_DATA_DIR | |
# set up mysql | |
sudo $MYSQL_DIR/scripts/mysql_install_db --user=mysql --basedir=$MYSQL_DIR --datadir=$MYSQL_DATA_DIR | |
# chmod mysql | |
sudo chown -R mysql:mysql $MYSQL_DATA_DIR | |
# start mysql | |
sudo $MYSQL_DIR/mysql.server start | |
# set mysql password | |
sudo $MYSQL_DIR/bin/mysqladmin -u root password 'loverackhub' | |
# restart mysql | |
sudo $MYSQL_DIR/mysql.server restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
15行目に
ps aux | grep mysqld
をしてみたのですがとなったのでrootでは動いてないですね。