Last active
August 29, 2015 13:56
-
-
Save igaiga/9225482 to your computer and use it in GitHub Desktop.
MySQL5.6 build in Linux
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
$ tar xvzf mysql-5.6.12.tar.gz | |
$ cmake -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci | |
$ make | |
$ sudo make install | |
.bash_profile などでmysqlへパスを通す | |
``` | |
# PATH | |
export PATH=$PATH:/usr/local/mysql/bin | |
``` | |
前のバージョンのデータフォルダ /var/lib/mysql、/etc/mysql/my.cnf がある場合は削除しておく | |
/etc/mysql/my.cnf のbase_dir を以下で指定する値にしておくこと。(以下の例だと "/usr/local/mysql") | |
エラーメッセージファイルを配置 | |
$ sudo cp -p ~/work/mysql-5.6.12/sql/share/japanese/errmsg.sys /usr/share/mysql/. | |
初期DBデータ作成 | |
$ sudo /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir="/usr/local/mysql" --datadir="/var/lib/mysql" | |
初期DBデータ作成でエラーが出たので以下を対応 | |
$ sudo ln -s /usr/local/mysql/bin/mysqld_safe /usr/bin/. | |
起動スクリプトコピー | |
$ sudo cp /usr/local/mysql/support-files/mysql.server mysqld | |
$ /usr/local/mysql/bin/mysqladmin -u root password 'PASS' | |
$ mysql -u root -p | |
mysql> grant all privileges on *.* to 'mysql'@'localhost' identified by 'PASS'; | |
mysql> flush privileges; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment