グループとユーザー追加
# groupadd mysql # useradd -s /sbin/nologin -g mysql mysql ←ログイン不可ユーザの追加
インストール
$ ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all --sysconfdir=/usr/local/mysql/etc --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock --enable-thread-safe-client --localstatedir=/var/lib/mysql --with-plugins=partition,innobase $ make # make install
初期設定
# mkdir /usr/local/mysql/etc # cp ./support-files/my-medium.cnf /usr/local/mysql/etc/my.cnf # /usr/local/mysql/bin/mysql_install_db --user=mysql ※Ubuntuでmysql_install_dbの実行でエラーが出るのは、 デフォルトで、mysql-commonがインストールされている為、そちらのmy.cnfが邪魔している。 その場合、以下で対応。 # cp support-files/my-medium.cnf /etc/my.cnf # mv /etc/mysql/my.cnf /etc/mysql/my_backup.cnf
続き
# cp ./support-files/mysql.server /etc/init.d/mysql # vi /etc/init.d/mysql # chkconfig: 2345 62 38 # chmod +x /etc/init.d/mysql # /sbin/chkconfig mysql on
起動
# /sbin/service mysql start
アカウント作成
mysql> GRANT ALL ON *.* TO tappe@localhost IDENTIFIED BY 'パスワード' WITH GRANT OPTION; mysql> GRANT ALL ON *.* TO tappe@'%' IDENTIFIED BY 'パスワード' WITH GRANT OPTION;