Linux - Mysql 설치

Posted 01 14, 2009 18:05, Filed under: DataBase/Mysql

-  압축 해지
  # tar -xvzf mysql-standard-4.1.22-pc-linux-gnu-i686-icc-glibc23.tar.gz

- /usr/local/mysql 폴더로 이동시킨다.
  # mv mysql-standard-4.1.22-pc-linux-gnu-i686-icc-glibc23 /usr/local/mysql
  # cd /usr/local/mysql

- 계정과 그룹을 지정하고 권한을 주도록 한다.
  # /usr/sbin/groupadd mysql
  # /usr/sbin/useradd -g mysql mysql

// mysql 에게 디렉토리 사용 권한을 줌
  # chown -R mysql:mysql mysql(설치 디렉토리)

// mysqld 디렉토리 생성
 # mkdir -p /var/run/mysqld

// 권한을 줌
 # chown -R mysql:mysql /var/run/mysqld

- 설치 명령 실행
  # ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data --with-charset=euckr

 설정파일 수정
# /etc/my.cnf
[root@localhost etc]# cat my.cnf

[mysqld]
datadir=/usr/local/mysql/data
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
    
[mysql.server]
user=mysql
basedir=/usr/local/mysql

[mysqld_safe]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pida

[client]
# sock 에러 발생시 변경
socket=/var/lib/mysql/mysql.sock


# 만약~  홈 디렉토리 명을 기본 mysql 로 사용하지 않고 mysql4.1.22  와 같이 사용할경우
 아래 경로의 mysqlaccess 파일에서 경로를 변경 해줌.

# vi /usr/local/mysql4.1.22/bin/mysqlaccess
$MYSQL     = '/usr/local/mysql4.1.22/bin/mysql';    # path to mysql executable


### 데이타 베이스 생성
[mysql@localhost mysql]$ /usr/local/mysql/scripts/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h localhost.localdomain password 'new-password'

See the manual for more instructions.

NOTE:  If you are upgrading from a MySQL <= 3.22.10 you should run
the ./bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!

You can start the MySQL daemon with:
cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the ./bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
### 데몬 시작
[mysql@localhost mysql]$ ./bin/mysqld_safe & 
[1] 9470
[mysql@localhost mysql]$ Starting mysqld daemon with databases from /var/lib/mysql

위와 같은 결과라면 데몬이 실행된 것임.

확인
[mysql@localhost mysql]$ps -ef | grep mysql

mysql 접속
# mysql -u root -p

- 실행되는지 테스트 해본다.
  # /usr/local/mysql/bin/mysqld_safe --user=mysql &

- 데몬이 무사히 실행됐다면 서버 시작시에 자동실행되도록 한다.
  # cp /usr/local/mysql/support-files/mysql.server /etc/rc.d/init.d
  # ln -s ../init.d/mysql.server /etc/rc.d/rc0.d/K01mysql
  # ln -s ../init.d/mysql.server /etc/rc.d/rc3.d/S90mysql

- 관리자 계정 패스워드 바꾸기
  # /usr/local/mysql/bin/mysqladmin -u root password '1234'

- Mysql 가동과 정지
  # /usr/local/mysql/bin/safe_mysqld &
  # /usr/local/mysql/bin/mysqladmin shutdown

  # mysqladmin -u root shutdown

01 14, 2009 18:05 01 14, 2009 18:05

Trackback URL : http://develop.sunshiny.co.kr/trackback/87

Leave a comment

« Previous : 1 : ... 314 : 315 : 316 : 317 : 318 : 319 : 320 : 321 : 322 : ... 381 : Next »

Recent Posts

  1. Oracle - 바인드 변수에 대하여(테스트)
  2. Oracle - 디폴트 롤, DBA, CONNECT,...
  3. Oracle - 권한 및 롤 관리
  4. Oracle - SQL*PLUS의 SYSDBA 접근 제어
  5. Oracle - PFILE, SPFILE 에 관하여

Recent Comments

  1. 네 답글 고맙습니다. 좋은 한주 보... sunshiny 05 14,
  2. 좋은 정보 잘 살펴보고 갑니다. ememoho 05 12,
  3. 네. 고맙습니다^^ 행복한 한해 보... sunshiny 01 16,
  4. sunshiny님. 안녕하세요... 올려 주... yihans 01 16,
  5. 답글 주셔서 고맙습니다^^ 소스 복... sunshiny 01 11,

Recent Trackbacks

  1. 윈도우 cmd 명령어 팁 월풍도원(月風道院) - Delight on th... %M
  2. 파일 압축 Like RadioHead %M
  3. Mysql - mysql 설치후 Character set... 멀고 가까움이 다르기 때문 %M

Calendar

«   05 2012   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Bookmarks

  1. 위키피디아
  2. MysqlKorea
  3. Oracle All Documentation
  4. 엑셈
  5. 오라클 클럽
  6. 네이버개발자센터
  7. API - Java
  8. API - Spring
  9. Java Community
  10. Reference - Spring
  11. 스프링사용자
  12. 자바소스
  13. 자바지기
  14. Ready System
  15. Solaris Freeware
  16. Linux-Site
  17. RedHat Korea
  18. 윈디하나의 솔라나라

Site Stats

TOTAL 245441 HIT
TODAY 147 HIT
YESTERDAY 139 HIT