yum install httpd mysql mysql-server php php-mysql
실행결과
[root@zetawiki ~]# yum install httpd mysql mysql-server php php-mysql
... (생략)============================================================================================================ Package Arch Version Repository Size============================================================================================================Installing: httpd x86_64 2.2.15-26.el6.centos base 821 k mysql x86_64 5.1.66-2.el6_3 base 885 k mysql-server x86_64 5.1.66-2.el6_3 base 8.6 M php x86_64 5.3.3-22.el6 base 1.1 M php-mysql x86_64 5.3.3-22.el6 base 81 kInstalling for dependencies: apr x86_64 1.3.9-5.el6_2 base 123 k apr-util x86_64 1.3.9-3.el6_0.1 base 87 k apr-util-ldap x86_64 1.3.9-3.el6_0.1 base 15 k httpd-tools x86_64 2.2.15-26.el6.centos base 72 k mailcap noarch 2.1.31-2.el6 base 27 k perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k perl-DBI x86_64 1.609-4.el6 base 705 k php-cli x86_64 5.3.3-22.el6 base 2.2 M php-common x86_64 5.3.3-22.el6 base 524 k php-pdo x86_64 5.3.3-22.el6 base 75 kUpdating for dependencies: mysql-libs x86_64 5.1.66-2.el6_3 base 1.2 MTransaction Summary============================================================================================================Install 15 Package(s)Upgrade 1 Package(s)Total download size: 17 MIs this ok [y/N]: y
[root@zetawiki ~]# service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 111.222.33.44 for ServerName [ OK ]
[root@zetawiki ~]# service mysqld start
Initializing MySQL database: Installing MySQL system tables...OKFilling help tables...OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default. This isstrongly 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.plcd /usr/mysql-test ; perl mysql-test-run.plPlease report any problems with the /usr/bin/mysqlbug script! [ OK ]Starting mysqld: [ OK ]
→ 정상이다. 1) 서버 재부팅시 자동시작 설정과, 2) root 패스워드 지정 안내이다. 다음 문단에서 처리할 것이므로 대충 보고 넘어가자.
/usr/bin/mysqladmin -u root password 'P@ssw0rd'
mysql -u root -p
→ P@ssw0rd 대신 원하는 패스워드를 기입한다.
실행예시
[root@zetawiki ~]# /usr/bin/mysqladmin -u root password 'P@ssw0rd'[root@zetawiki ~]# mysql -u root -p
Enter password:
→ 지정한 패스워드 입력 후 ↵ Enter
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.1.52 Source distributionCopyright (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 licenseType 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>
→ show databases; 입력 후 ↵ Enter
mysql> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || test |+--------------------+3 rows in set (0.00 sec)mysql>