'5.5.9'에 해당되는 글 1건

  1. 2011.02.23 mysql 5.5.9 linux 버전 설치 1
- 컴퓨터/database2011. 2. 23. 16:41

먼저 mysql.com 에서 mysql 을 다운 받아야 한다.
Downloads -> mysql community server  를 선택한다.
플랫폼과 자신의 cpu 에 맞는 버전을 선택하여 오른쪽의 download 를 클릭한다.
로그인 후에 다운이완료 되면

tar -xf MySQL-5.5.9-1.rhel5.i386.tar
를 하여 압축을 푼다.
압축을 풀어보면 전부 rpm 이다.. 이중에서

rpm -Uvh MySQL-server-5.5.9-1.rhel5.i386.rpm  MySQL-shared-5.5.9-1.rhel5.i386.rpm MySQL-client-5.5.9-1.rhel5.i386.rpm
3가지를 선택하여 설치를 해 준다.

설치를 완료 하면


--------------------
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain2 password 'new-password'

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

Please report any problems with the /usr/bin/mysqlbug script!
--------------------
라는 메시지나 나오는데 server 쪽의 설치에 관한 메시지 이다.


비번을 변경하기 전에 우선 mysql 서버를 띄운다.
service mysql start 혹은 /etc/rc.d/init.d/mysql start
로서 mysql 서버를 실행 시킨다.

mysqladmin -u root password 'new-password'
로서 root 의 비번을 변경 시켜준다.

종료는
service mysql stop 혹은 /etc/rc.d/init.d/mysql stop
로서 한다.


혹시 mysql data 가 저장되는 경로를 변경하거나,
사용하는 메모리 관련 옵션을 변경하고 싶다면
/etc/my.cnf 를 반들어 주고 mysql.server 파일을 /usr/local/bin 디렉토리에
이동 시켜주어야 한다.

/usr/share/mysql
디렉토리에 이 파일들이 있는데
my-large.cnf 파일을 /etc/my.cnf 파일로 이름을 변경하여 이동 시키고,

(mysql 데이터를 /var/lib/mysql 에서 /home/mysql 로 이동키 려고 할 경우)

[client]
#password       = your_password
port            = 3306
socket          = /home/mysql/mysql.sock  <--

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port            = 3306
socket          = /home/mysql/mysql.sock   <--

등으로 (화살표 두줄) 을 변경 시켜 준다.

그리고
cp -rf /var/lib/mysql /home/mysql
로서 데이터를 이동 시킨다.

/usr/share/msyql/mysql.server 파일에서

datadir=/home/mysql
로 변경 해서
mysql.server 파일을 /usr/local/bin 디렉토리로 복사한다.

마지막으로
chown -R mysql:mysql /home/mysql
을 하여 mysql 계정에게 데이터에 대한 실행 권한을 준다.


이제  실행때는 mysql.server start  / 종료때는  mysql.server stop
를 해주면 된다.

Posted by 스푸라이트