CentOS 5에 MySQL 5.5 설치 (yum)


1 확인[ | ]

Console
Copy
[root@zetawiki ~]# rpm -qa | grep mysql
→ 설치 안됨
Console
Copy
[root@zetawiki ~]# yum list mysql-server
... (생략)
Available Packages
mysql-server.x86_64                                5.0.95-5.el5_9                                 base
→ CentOS 기본 저장소로 설치가능하나, 5.0.95 버전임

2 webtatic 저장소 추가[ | ]

3 yum으로 설치[ | ]

Console
Copy
[root@zetawiki ~]# yum --enablerepo=webtatic install mysql55-server
... (생략)
======================================================================================================
 Package                      Arch               Version                   Repository            Size
======================================================================================================
Installing:
 mysql55-server               x86_64             5.5.34-1.w5               webtatic              13 M
Installing for dependencies:
 libmysqlclient15             x86_64             5.0.95-5.w5               webtatic             1.3 M
 mysql55                      x86_64             5.5.34-1.w5               webtatic             7.4 M
 mysql55-libs                 x86_64             5.5.34-1.w5               webtatic             1.1 M
 perl-DBD-MySQL               x86_64             3.0007-2.el5              base                 148 k

Transaction Summary
======================================================================================================
Install       5 Package(s)
Upgrade       0 Package(s)

Total download size: 23 M
Is this ok [y/N]: y
Console
Copy
... (생략)
Installed:
  mysql55-server.x86_64 0:5.5.34-1.w5                                                                 

Dependency Installed:
  libmysqlclient15.x86_64 0:5.0.95-5.w5              mysql55.x86_64 0:5.5.34-1.w5                     
  mysql55-libs.x86_64 0:5.5.34-1.w5                  perl-DBD-MySQL.x86_64 0:3.0007-2.el5             

Complete!

4 서비스 시작[ | ]

Console
Copy
[root@zetawiki ~]# service mysqld start
Initializing MySQL database:  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:

/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h jmnote 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.

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

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

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

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

5 패스워드 변경[ | ]

Console
Copy
[root@zetawiki ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'
→ MySQL의 root계정[1] 패스워드를 P@ssw0rd로 바꾸었다.
→ 실패하는 경우에는 MySQL 패스워드 초기설정 실패 참고

6 로컬 접속 확인[ | ]

Console
Copy
[root@zetawiki ~]# mysql -uroot -p
Enter password:
Console
Copy
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.34 MySQL Community Server (GPL)

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> quit
Bye
[root@zetawiki ~]#

7 부팅시 자동시작 설정[ | ]

Console
Copy
[root@zetawiki ~]# chkconfig mysqld on
[root@zetawiki ~]# chkconfig --list mysqld 
mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off

8 같이 보기[ | ]

9 주석[ | ]

  1. OS계정이 아니라 DB계정임
편집자 J Jmnote Jmnote bot 211.115.202.240
  • CentOS MySQL 설치
    RHEL5.x 버전에서 MySQL-5.5.45 버전 설치시, /usr/bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data 와 같이 설정해 주지 않으면 정상 동작하지 않는 경우가 있었습니다. 확인 바랍니다.
  • CentOS phpMyAdmin 설치 (yum)
    위에 서술되어 있는대로 설치하였는데 http://서버주소/phpMyAdmin 이 브라우저에서 페이지를 표시할 수 없다는 메세지가 나오네요...ㅠㅠ 새로운 서버에 centos 6.7을 설치하였고 MySql도 설치 하였습니다. 또한 워드프레스도 지침대로 설치하였는데 위와 같은 결과가 Shinch25
  • CentOS phpMyAdmin 설치 (yum)
    로컬에서만 접속되는 보안설정이 있네요. '(Optional) 외부접속 허용 및 확인' 문단을 추가했습니다. 참고하세요.J Jmnote
  • CentOS phpMyAdmin 설치 (yum)
    감사합니다. 브라우저문제는 해결이 되었는데 "설정파일 생성 및 확인" 과 같이 http://서버주소/phpMyAdmin /setup 을 실행하여 변경없이 화면 그대로 저장을 하였습니다. 브라우저에서 phpMyAdmin/index.php 를 샐행하여 사용자명은 root로 하고 패스워드는 Shinch25
  • CentOS phpMyAdmin 설치 (yum)
    config.inc.php 파일은 별 문제가 없는 것 같습니다. 마지막 문단에 추가했듯이 http://zetawiki.com/wiki/MySQL_ERROR_1045_접근_거부 문서를 참고하시면 될 것 같네요.J Jmnote
  • CentOS phpMyAdmin 설치 (yum)
    감사합니다. 모두 해결되어 phpadmin 작동이 정상으로 되었습니다. 실무 안해본지 20년이 되어가다보니 명령어도 많이 잊어 버렸고...ㅠㅠ 암튼 감사드리며 워드프레스 공부하며 모르는 것 염치 없지만 또 물어 보겠습니다. Shinch25
  • CentOS phpMyAdmin 설치 (yum)
    아파치 웹서버와 tomcat를 연동 한 상태에서 위와 같이하면 phpmyadmin을 사용할수 있나요???? Tndyd5390
  • CentOS phpMyAdmin 설치 (yum)
    기존 아파치 설정을 알 수 없어서 자세한 것을 말씀드리기는 어렵고요. 아파치 설정에 80포트 외의 포트번호를 지정하여 VirtualHost를 추가하고 phpmyadmin 디렉토리를 기입하여 사용하면 될 것 같네요.J Jmnote
  • CentOS phpMyAdmin 설치 (yum)
    댓글 수정기능도 필요할 듯합니다 Ijeff
  • CentOS phpMyAdmin 설치 (yum)
    무튼 "브라우저에서 http://서버주소/phpMyAdmin 으로 접속 확인" 이 과정에서 UI가 아닌 php소스코드가 출력됩니다 버그인 것 같습니다. 불특정하게 한줄이상 쓰면 문장이 계속 짤립니다 Ijeff
  • CentOS phpMyAdmin 설치 (yum)
    '사전작업' 수정했습니다. PHP 소소코드가 그대로 출력되는 것은 1) PHP 설치가 안된 경우, 2) PHP모듈이 Apache와 연동되지 않은 경우, 둘 중 하나인데 1)일 것 같습니다.J Jmnote
  • CentOS phpMyAdmin 설치 (yum)
    댓글 잘리는 문제는 글자수를 표시하고 제한을 해야겠네요.J Jmnote
  • CentOS phpMyAdmin 설치 (yum)
    감사합니다. "http://서버주소/phpMyAdmin/setup 접속" 부분 일부 추가합니다 Ijeff