메뉴 건너뛰기

[리눅스]MySQL 소스설치(5.1.69)

관리자 2016.07.19 08:51 조회 수 : 2044

리눅스 APM(Apache+PHP+MySQL) 및 Openssl 설치하기


1. MySQL 소스설치
2. Openssl 소스설치
3. 아파치(Apache) 소스설치
4. PHP 소스설치

5. APM+OpenSSL 연동하기

gcc 설치 # yum -y install gcc*

1. 소스 다운로드(5.1.69버전)
(5.5 이상 버전은 cmake 사용하는데 여기서는 다루지 않습니다.)
MySQL 유저생성
# useradd -M -s /bin/false mysql

2. MySQL 데이터 파일 및 로그파일 디렉토리 생성. 권한설정(MySQL 유저)
[root@divweb3 mysql]# cd /home 
[root@divweb3 home]# mkdir mysql 
[root@divweb3 home]# cd mysql 
[root@divweb3 mysql]# mkdir data 
[root@divweb3 mysql]# mkdir log 
[root@divweb3 mysql]# chown mysql.mysql data/ 
[root@divweb3 mysql]# chown mysql.mysql log/ 

3. 소스 압축풀기. configure
[root@divweb3 mysql]# cd /usr/local/src 
[root@divweb3 src]# tar xvzf mysql-5.1.69.tar.gz 
[root@divweb3 src]# cd mysql-5.1.69 
[root@divweb3 mysql-5.1.69]# ./configure --prefix=/usr/local/mysql --datadir=/home/mysql/data --with-charset=utf8 --with-extra-charsets=complex
checking for tgetent in -lcurses... no 
checking for tgetent in -ltermcap... no 
checking for tgetent in -ltinfo... no 
checking for termcap functions library... configure: error: No curses/termcap library found 
1) MySQL 설치 에러 : configure: error : No curses/termcap library found
termcap 라이브러리 설치
[root@localhost ~]# yum -y install libtermcap-devel ncurses-devel

2) gcc* 설치 안하면 /depcomp: line 571: exec: g++: not found
g++ 라이브러리가 설치가 안될 경우, 에러 발생
# yum -y install gcc-c++


[root@divweb3 mysql-5.1.69]# ./configure --prefix=/usr/local/mysql --datadir=/home/mysql/data --with-charset=utf8 --with-extra-charsets=complex
/bin/rm: cannot remove `libtoolT': No such file or directory   -- 무시하고 진행
config.status: executing default commands 

Thank you for choosing MySQL! 

Remember to check the platform specific part of the reference manual 
for hints about installing MySQL on your platform. 
Also have a look at the files in the Docs directory. 

4. MySQL 설치
[root@divweb3 mysql-5.1.69]# make 
[root@divweb3 mysql-5.1.69]# make install 

5. MySQL 기본 DB 생성 스크립트 실행
[root@divweb3 mysql-5.1.69]# ./scripts/mysql_install_db 
Installing MySQL system tables... 
OK 
Filling help tables... 
OK 

Please report any problems with the /usr/local/mysql/bin/mysqlbug script! 

6. MySQL 데몬 실행
[root@divweb3 mysql-5.1.69]# /usr/local/mysql/bin/mysqld_safe --user=root & 
[1] 4384 
[root@divweb3 mysql-5.1.69]# 160306 20:13:31 mysqld_safe Logging to '/var/log/mysqld.log'. 
160306 20:13:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 
160306 20:13:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended 

160306 20:13:31 [ERROR] /usr/local/mysql/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2) 
160306 20:13:31 [ERROR] Can't start server: can't create PID file: No such file or directory 
-- PID 생성오류

[root@divweb3 mysql-5.1.69]# cd /var/run/

[root@divweb3 run]# mkdir mysqld
[root@divweb3 run]# chown -R mysql.mysql mysqld/ 
[root@divweb3 run]# /usr/local/mysql/bin/mysqld_safe --user=root &  --> 정상적으로 MySQL 데몬 실행됨


[root@divweb3 run]# /usr/local/mysql/bin/mysql -u root -p 
Enter password: 
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) --socket '/tmp/mysql.sock' 접속오류
[root@divweb3 mysql]# ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock   또는
[root@divweb3 mysql]# ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock


[root@divweb3 run]# /usr/local/mysql/bin/mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 1 
Server version: 5.1.69 Source distribution 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 

Oracle is a registered trademark of Oracle Corporation and/or its 
affiliates. Other names may be trademarks of their respective 
owners. 

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

mysql> use mysql 
Reading table information for completion of table and column names 
You can turn off this feature to get a quicker startup with -A 

Database changed 
mysql> show databases; 
+--------------------+ 
| Database | 
+--------------------+ 
| information_schema | 
| mysql | 
| test | 
+--------------------+ 
3 rows in set (0.00 sec) 

mysql> show character set;   -- euckr, utf8 확인
+----------+-----------------------------+---------------------+--------+ 
| Charset | Description | Default collation | Maxlen | 
+----------+-----------------------------+---------------------+--------+ 
| big5 | Big5 Traditional Chinese | big5_chinese_ci | 2 | 
| dec8 | DEC West European | dec8_swedish_ci | 1 | 
| cp850 | DOS West European | cp850_general_ci | 1 | 
| hp8 | HP West European | hp8_english_ci | 1 | 
| koi8r | KOI8-R Relcom Russian | koi8r_general_ci | 1 | 
| latin1 | cp1252 West European | latin1_swedish_ci | 1 | 
| latin2 | ISO 8859-2 Central European | latin2_general_ci | 1 | 
| swe7 | 7bit Swedish | swe7_swedish_ci | 1 | 
| ascii | US ASCII | ascii_general_ci | 1 | 
| ujis | EUC-JP Japanese | ujis_japanese_ci | 3 | 
| sjis | Shift-JIS Japanese | sjis_japanese_ci | 2 | 
| hebrew | ISO 8859-8 Hebrew | hebrew_general_ci | 1 | 
| tis620 | TIS620 Thai | tis620_thai_ci | 1 | 
| euckr | EUC-KR Korean | euckr_korean_ci | 2 | 
| koi8u | KOI8-U Ukrainian | koi8u_general_ci | 1 | 
| gb2312 | GB2312 Simplified Chinese | gb2312_chinese_ci | 2 | 
| greek | ISO 8859-7 Greek | greek_general_ci | 1 | 
| cp1250 | Windows Central European | cp1250_general_ci | 1 | 
| gbk | GBK Simplified Chinese | gbk_chinese_ci | 2 | 
| latin5 | ISO 8859-9 Turkish | latin5_turkish_ci | 1 | 
| armscii8 | ARMSCII-8 Armenian | armscii8_general_ci | 1 | 
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 | 
| ucs2 | UCS-2 Unicode | ucs2_general_ci | 2 | 
| cp866 | DOS Russian | cp866_general_ci | 1 | 
| keybcs2 | DOS Kamenicky Czech-Slovak | keybcs2_general_ci | 1 | 
| macce | Mac Central European | macce_general_ci | 1 | 
| macroman | Mac West European | macroman_general_ci | 1 | 
| cp852 | DOS Central European | cp852_general_ci | 1 | 
| latin7 | ISO 8859-13 Baltic | latin7_general_ci | 1 | 
| cp1251 | Windows Cyrillic | cp1251_general_ci | 1 | 
| cp1256 | Windows Arabic | cp1256_general_ci | 1 | 
| cp1257 | Windows Baltic | cp1257_general_ci | 1 | 
| binary | Binary pseudo charset | binary | 1 | 
| geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 | 
| cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 | 
| eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 | 
+----------+-----------------------------+---------------------+--------+ 
36 rows in set (0.00 sec)


mysql> quit 
Bye

번호 제목 글쓴이 날짜 조회 수
34 git, github 사용하기. vscode에서 github 연동하기(2023.02.09) file 관리자 2023.02.08 1298
33 록키리눅스(Rocky Linux) 네트워크 설정하기 - nmcli, nmtui file 관리자 2023.02.01 35627
32 CentOS 종료 대비, 록키 리눅스(Rocky Linux) 설치하기 file 관리자 2023.01.27 1360
31 플래시 설치파일 file 관리자 2021.01.13 356
30 tar 압축하면서 다른 디렉토리에 풀기 file 관리자 2020.11.14 475
29 리눅스 하드디스크 추가 관리자 2019.02.12 1431
28 [MySQL]ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 관리자 2018.12.23 1295
27 [리눅스]phpinfo() 실행 시 하얀 화면이 나타날 경우 대처방법 file 관리자 2018.12.13 3703
26 [리눅스]rsync 설정 후, crontab 스케줄 등록 관리자 2018.08.28 2740
25 [리눅스][XE]백업복구(서버이관) 시 오류-03.사이트 메뉴 편집, 사이트 디자인 설정 출력 안되는 현상 file 관리자 2018.08.27 11124
24 [리눅스][XE]백업복구(서버이관) 시 오류-02.아파치 rewrite에러 file 관리자 2018.08.27 516
23 [리눅스][XE]백업복구(서버이관) 시 오류-01.No matching DirectoryIndex (index.html) fonud 오류 file 관리자 2018.08.27 1461
22 [리눅스][XE][오류]msg_is_not_administrator file 관리자 2018.08.08 1242
21 [리눅스]CentOS에서 하드디스크 추가 관리자 2018.03.21 8843
20 [리눅스]리눅스 파일 압축 암호 설정 및 해제(ZIP) 관리자 2017.07.30 18083
19 [리눅스]CentOS 7,최신 APM 소스설치-5) PHP, gd library jpeg support file 관리자 2017.02.21 1853
18 [리눅스]CentOS 7 root password 분실 file 관리자 2016.12.27 6353
17 [리눅스]vsftpd ftp 파일전송오류(451 Failure writing to local file) 관리자 2016.12.20 4117
16 [리눅스]APM(apache+php+mysql) 다른서버로 이관하기(백업-복구하기) 관리자 2016.09.12 4673
15 [리눅스]XE(XpressEngine)설정 file 관리자 2016.07.26 684