2009년 11월 25일 수요일

[MySQL] 설치 및 설정

* OS : CentOS 5.2
* MySQL : 5.1.38
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-extra-charsets=all
# make && make install
# useradd mysql -g daemon -u 60 -M -s /bin/false -c "Mysql Server User" -d /usr/local/mysql
# groupadd mysql
# /usr/local/mysql/bin/mysql_install_db
# chown -R root.mysql /usr/local/mysql
# chown -R mysql.mysql /usr/local/mysql/data
# chmod 700 /usr/local/mysql/data

# /usr/local/mysql/bin/mysqld_safe &
# ./mysql -u root
mysql> use mysql;
mysql> DELETE FROM user WHERE user='';
mysql> DELETE FROM user WHERE user='root' AND host='불필요호스트명';
mysql> UPDATE user SET host='%', password=PASSWORD('암호') WHERE user='root';
mysql> FLUSH PRIVILEGES;

# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf
# cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
# chkconfig --add mysqld
# chkconfig --level 3 mysqld on
# chkconfig --list mysqld

# service mysqld start

댓글 없음:

댓글 쓰기