우선 원하는 MySQL 버전을 다운로드 받자

 - Product Version : 5.1.52

 - Operating System : Source Code

 - OS Version : Linux Generic (glibc 2.3)

https://downloads.mysql.com/archives/community

( 현재 회사에서 사용하는 MySQL이 5.1.52 버전이라 해당 버전으로 설치 진행 )


설치 서버는 redhat 6


설치 전에 /etc/my.cnf를 /etc/my.cnt_bk로 바꾸자

( mysql이 기본적으로 /etc/my.cnf를 보게 되어 있어 /usr/local/mysql/data/my.cnf를 수정해도 반영이 안됨 )


받은 패키지를 원하는 위치에 압축을 풀고

OAMPKB2A [ app{52} ~/DB/mysql ] tar xvf mysql-5.1.52-linux-x86_64-glibc23.tar.gz



root 계정에서 /usr/local/mysql 을 link 걸자

# cd /usr/local
# sudo ln -s /home/app/DB/mysql/mysql-5.1.52-linux-x86_64-glibc23 mysql
# ls -l
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 bin
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 etc
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 games
drwxr-xr-x. 3 root root 4096 2019-02-08 05:31 hp
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 include
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 lib
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 lib64
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 libexec
lrwxrwxrwx. 1 root root   52 2019-02-13 09:43 mysql -> /home/app/DB/mysql/mysql-5.1.52-linux-x86_64-glibc23
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 sbin
drwxr-xr-x. 5 root root 4096 2019-02-08 03:28 share
drwxr-xr-x. 2 root root 4096 2011-06-28 21:13 src


이후 /usr/local/mysql 위치에서 ./scripts/mysql_install_db 명령어 수행

# cd /usr/local/mysql
# ./scripts/mysql_install_db

WARNING: The host 'OAMPKB2A' could not be looked up with resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Filling help tables...
OK

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 OAMPKB2A password 'new-password'

Alternatively you can run:
./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.

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

You can test the MySQL daemon with mysql-test-run.pl
cd ./mysql-test ; perl mysql-test-run.pl

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


mysqld_safe & 로 기동

# /usr/local/mysql/bin/mysqld_safe &
[1] 29641
190213 10:00:38 mysqld_safe Logging to '/usr/local/mysql/data/OAMPKB2A.err'.
190213 10:00:38 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data


아래의 명령어로 root 비번을 원하는 걸로 바꾸자

# /usr/local/mysql/bin/mysqladmin -u root password root.123

접속 확인

# mysql -uroot -proot.123
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.52-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>



'Database > MySQL' 카테고리의 다른 글

[MySQL] mysql-relay 로그가 많이 남는 경우 조치 방법  (0) 2019.07.11
[MySQL] Replication 걸기  (0) 2019.02.14

+ Recent posts