블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글

6200558_my.txt

지금부터는 db 서버를 설치하겠습니다. mysql은 많은 프로그램과 연동이 가능하며, linux에서 유용하게 사용할 수 있는 dbms입니다. 아직 안정화된 버전에는 dbms의 중요 기능인 트랜젝션 처리 및 사용자정의 함수 등 부족한 점이 있지만 ( 이 부분은 db의 기능보다는 성능과 가볍게 만든다고 뺏다고 하더군요^^) 대부분 잘~~ 사용하지 않는 기능들입니다. mysql은 안정성 및 성능면에서 우수하죠^^;

(1) 설치
설치는 성능을 약 10% 정도 끌어올려준다는 static 모드로 설치하겠습니다.

[root@localhost local]# wget http://ftp.superuser.co.kr/pub/mysql/mysql-4.0.20.tar.gz
[root@localhost local]# tar xvfz mysql-4.0.20.tar.gz
[root@localhost local]# cd mysql-4.0.20
[root@localhost mysql-2.0.20]# CFLAGS="-static -O2 -march=i686 -funroll-loops" \
CXXFLAGS="-static -O2 -march=i686 -funroll-loops -felide-constructors -fno-exceptions -fno-rtti" \

./configure \
--prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data \
--disable-shared --enable-assembler \
--with-thread-safe-client --with-mysqld-user="mysql" \
--with-client-ldflags=-all-static \
--with-mysqld-ldflags=-all-static \

--with-readline --without-debug \
--without-docs --without-bench \
--with-charset=euc_kr

MySQL 4.1.X 에서는 --with-charset=euckr 으로 해야 합니다.
위 설정에서 static 모드로 설치하며, 언어는 많이 사용하는 euc_kr로 설치합니다.
데이터 디렉토리는 /usr/local/mysql/data 에 저장하게 설정합니다.

[root@localhost mysql-2.0.20]# make && make install
[root@localhost mysql-2.0.20]# cd ..
[root@localhost local]# rm -rf mysql-4.0.20.tar

이렇게 한방에 컴파일 및 설치까지 합니다.

(2) 설정 파일 복사
메모리에 따라서 환경 설정 파일들을 복사해 줍니다.
my-huge.cnf 1~2G
my-large.cnf 512M
my-medium.cnf 128M~ 256M
my-small.cnf 64M 이하
위와같이 나와있지만 위 설정은 db 서버 전용으로 사용했을 때 설정입니다. 기본적을 my-medium.cnf를 복사한 다음 시스템에 맞게 설정해서 사용해야 합니다 .(모든게 그렇듯 절대적인 것이 아닙니다.)
[root@localhost local]# cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf

(3) 기본 db 생성
[root@localhost local]# /usr/local/mysql/bin/mysql_install_db

(4) mysql 운영 사용자 생성
홈 디렉토리는 필요 없기 때문에 -M 옵션을 주어서 사용자를 생성합니다.
[root@localhost local]# useradd -M mysql

(5) data 디렉토리를 mysql이라는 사용자 권한으로 바꾸어 주어야 합니다.
[root@localhost local]# chown -R mysql:mysql /usr/local/mysql/data
mak
(6) 아무곳에서나 mysql 및 mysqldump 명령어를 실행가능하게 심볼릭 링크를 걸어줍니다.
[root@localhost local]# ln -s /usr/local/mysql/bin/mysql /usr/bin/
[root@localhost local]# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/

(7) mysql 데몬을 실행시킵니다.
[root@localhost local]# /usr/local/mysql/bin/mysqld_safe &

(8) mysql root 비밀번호를 설정합니다.
[root@localhost local]# /usr/local/mysql/bin/mysqladmin -u root password "암호"

(9) 운영중에 조취법&^^
- mysql root 비밀번호 잊어 먹었을 때
[root@localhost local]# killall mysqld
[root@localhost local]# /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
[root@localhost local]# mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 2 to server version: 4.0.20-log

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.
mysql> use mysql
Database changed
mysql> update user set password=password('비밀번호') where user='root';
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2 Changed: 2 Warnings: 0

mysql> exit
Bye
[root@localhost local]# killall mysqld
[root@localhost local]# /usr/local/mysql/bin/mysqld_safe &

(9) MySQL 4.0.X 에서 MySQL 4.1.X 달라진점
4.0.X 에선 4.1.X 는 많은 변화들이 있습니다. 모두 기술하기는 힘들고, 중효한 몇가지만 기술하도록 하겠습니다.
1. mysql 4.1의 table 이름은 utf8으로 저장(한글 테이블명을 사용할수 없습니다.)
2. mysql db 에 user 테이블의 password 필드가 더 길어졌습니다.(16->41)
3. password 다루는 방식이 달라졌습니다. 보안을 강하게 하기 위해서 hashing 메커니즘이 바뀌었습니다.
- hashing 이 16바이트에서 41바이트바뀌었습니다. 보이는건 45바이트. 4바이트는? 소금^^;
- 새로운 포멧은 *부터 시작. 예전포멧은 그렇지 않았습니다.
- 예전 포멧을 사용하려면, old_password()함수를 사용해야 합니다.
4. configure 할때 --with-charset=euc_kr 에서 --with-charset=euckr 으로 바뀌었습니다.
*. 더 자세한 것은. ... http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html 참조하세요

'01.MySQL' 카테고리의 다른 글

[MySQL]MySQL 암호화-복호화  (1) 2012.12.19
[MySQL]MySQL 파라메터 튜닝  (0) 2012.12.19
[MySQL]큰 사이즈 데이터 INSERT 방법  (0) 2012.12.19
[MySQL]Replicate Heartbit 구성  (0) 2012.12.19
[MySQL]MySQL 환경변수 파일  (0) 2012.12.19
Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함