====== MySQLのインストール ====== Portsからのインストールは、[[02_freebsd:02_www:apache_2.0&#インストール_mysql|インストール(MySQL)]] ====== ソースを取ってくる ====== この辺からダウンロードしてくる~ http://www.mysql.com/ ====== 展開 ====== $ tar zxvf mysql-5.0.51b.tar.gz $ cd mysql-5.0.51b ====== mysqlユーザ作成 ====== pw groupadd mysql pw useradd mysql -g mysql -d /usr/local/ -s /usr/sbin/nologin ====== インストール ====== $ ./configure --prefix=/usr/local/mysql --with-charset=ujis --with-extra-charsets=all --with-mysqld-user=mysql --localstatedir=/home/mysql/data or $ ./configure --prefix=/usr/local/mysql --with-charset=utf8 --with-extra-charsets=all --with-mysqld-user=mysql --localstatedir=/home/mysql/data MySQLのスレッドセーフなクライアントライブラリである「libmysqlclient_r.so」を組み込む場合下記を付ける --enable-thread-safe-client $ make # make install ===== CentOS5.2でconfigureした時のエラー ===== こんなエラーでコンフィグできません。 $ ./configure --with-charset=ujis --with-extra-charsets=all --with-mysqld-user=mysql ・ ・ ・ checking for termcap functions library... configure: error: No curses/termcap library found これでコンフィグできました。 $ yum install ncurses-devel ====== 設定ファイルのコピー ====== # cp support-files/my-medium.cnf /etc/my.cnf # cp support-files/mysql.server /usr/local/etc/rc.d/mysql.sh # chmod 755 /usr/local/etc/rc.d/mysql.sh ====== 設定ファイルの編集 ====== 今回の場合/home/mysql/dataにデータを置くこととする。 # vi /etc/my.cnf [mysqld] port = 3306 socket = /tmp/mysql.sock datadir=/home/mysql/data ====== データベース作成 ====== # /usr/local/bin/mysql_install_db --user=mysql ====== 起動 ====== # /usr/local/etc/rc.d/mysql.sh start ====== バイナリログの削除 ====== my.cnfに下記を追加 expire_logs_days=7 ====== エラー集 ====== ==== エラー(MySQL 5.1.30) ==== # /usr/local/bin/mysql_install_db --user=mysql Installing MySQL system tables... 090129 20:58:54 [ERROR] /usr/local/libexec/mysqld: unknown option '--skip-federated' my.cnfでskip-federatedをコメントアウトすれば、起動できるようになった。 # Disable Federated by default skip-federated ==== makeでエラーする。(regoff_t) ==== /usr/include/regex.h:46: syntax error before `regoff_t' /usr/include/regex.h:46: warning: data definition has no type or storage class /usr/include/regex.h:56: syntax error before `regoff_t' *** Error code 1 Stop in /usr/local/src/mysql-5.0.83/cmd-line-utils/libedit. *** Error code 1 Stop in /usr/local/src/mysql-5.0.83/cmd-line-utils. *** Error code 1 Stop in /usr/local/src/mysql-5.0.83. *** Error code 1 ■対処 # vi /usr/include/regex.h ---------------<追加>---------------------- #include ==== configureでこんなエラーが・・・ ==== [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523750>http://bugs.debian.org/cgi- bin/bugreport.cgi?bug=523750]] ここによれば既存のバグらしい とりあえず無視してよい様子。 # configure ・ ・ ・ /bin/rm: cannot remove `libtoolT': No such file or directory