Dondariadmin (トーク | 投稿記録) (ページの作成:「== MySQL 5.1 をソースからインストールする手順メモ == === 環境&目標 === *CentOS 5 *実行ユーザはrootにしない *mysqlのデータを別の...」) |
Dondariadmin (トーク | 投稿記録) |
||
73行目: | 73行目: | ||
mysql> grant all on test.* to testuser@localhost identified by 'testpass'; | mysql> grant all on test.* to testuser@localhost identified by 'testpass'; | ||
+ | |||
+ | [[Category:Linux]] | ||
+ | [[Category:MySQL]] |
# groupadd mysql # useradd -g mysql mysql
# mkdir /var/mysqldata # chown -R mysql.mysql /var/mysqldata
# cd /usr/local/src # tar zxvf mysql-5.1.29-rc.tar.gz # cd mysql-5.1.29-rc # ./configure --localstatedir=/var/mysqldata --with-charset=utf8 --with-mysqld-user=mysql \ --without-bench --without-docs # make # make install
# cp support-files/my-small.cnf /etc/my.cnf
[mysqld] datadir = /var/mysqldata thread_stack = 128K
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
ここでもデータディレクトリ、ユーザを指定する。
# ./scripts/mysql_install_db --datadir=/var/mysqldata/ --user=mysql
起動エラーにならず、接続できる(mysql> プロンプト表示)ことを確認する。
# /usr/local/bin/mysqld_safe & # mysql
添付スクリプトをそのまま使う
# cp ./support-files/mysql.server /etc/init.d/mysql # chmod 755 /etc/init.d/mysql
mysql> grant all on test.* to testuser@localhost identified by 'testpass';Tweet