Server-Side/Linux2011. 9. 23. 15:22
Download

Make user & group for MySQL
# groupadd mysql
# useradd -g mysql mysql

Install MySQL
# cd /usr/local/src
# tar xzfv mysql-5.1.59.tar.gz
# cd mysql-5.1.59.tar.gz
# ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=utf8 --with-collation=utf8_general_ci --with-plugins=innobase
# make
# make install

Configuration

# cp support-files/my-small.cnf /etc/my.cnf
# chown root /etc/my.cnf 
# chgrp root /etc/my.cnf
# chmod 644 /etc/my.cnf 

# vi /etc/my.cnf
[mysqld]
user = mysql


Install DB

# /usr/local/mysql/bin/mysql_install_db --user=mysql


Run MySQL

# /usr/local/mysql/bin/mysqld_safe --user=mysql &

# mysql -u root -p 


Automatic startup

# cp support-files/mysql.server /etc/init.d/mysql
# chmod 755 /etc/init.d/mysql
# chkconfig --add mysql
# chkconfig --level 35 mysql on 



reference
 - how to install mysql


Posted by 준피
Server-Side/MySQL2011. 9. 10. 16:15
1. 설정파일 변경

# vi /etc/my.cnf

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake 

위에 있는 세가지 옵션을 추가 또는 변경한다.

2. 확인

# mysql -u root -p
mysql> show variables like 'c%';

character_set_client : utf8
character_set_connection : utf8
character_set_database : utf8
character_set_results : utf8
character_set_server : utf8
character_set_system : utf8
character_sets_dir : /usr/share/mysql/charsets/
collation_connection : utf8_general_ci
collation_database : utf8_general_ci
collation_server : utf8_general_ci

이렇게 변경된 것을 확인할 수 있다.


Reference 

http://kldp.org/node/99186 
Posted by 준피