First, install and configure MySQL
1.1 Execute the yum command to install MySQL
| Yum-y install MySQL Mysql-server |
1.2 Add MySQL into boot entry and start MySQL now
Chkconfig--levels 235 mysqld on /etc/init.d/mysqld start |
1.3 Setting the MySQL root account password
Set MySQL root user password, open MySQL remote management
Mysqladmin-u root password "New user password"--Set root user password
Mysql-u root-p--Login to MySQL console
Mysql>grant all privileges on * * to ' root ' @ '% ' identified by ' user password ';
Mysql>flush privileges;
mysql>exit; --Open Telnet permission
Second, installationApache
2.1 Installing Apache with the yum command
2.2 Set boot up Apache
| Chkconfig--levels 235 httpd on |
2.3 Launch Apache
2.4 Now directly in the browser type http://localhost or HTTP///native IP, you should see the Apache test page
Third, install the configuration php
3.1 Installing PHP using the Yum command
3.2 Restarting the Apache server
| /ETC/INIT.D/HTTPD restart |
3.3 Installing the relevant modules using PHP support MySQL: In order for PHP to support MySQL, we can install the Php-mysql package, or use the following command to search for available PHP modules
Select the required modules for installation
| Yum–y Install php-mysql php-common php-mbstring php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc |
3.4 Restarting the Apache server
| /ETC/INIT.D/HTTPD restart |
Third, test PHP related information This step can actually be omitted, but in order to test whether the installation is successful, you can create a new PHP page to test, using the VIM editor to create a new:[[email protected] ~]# vi /var/www/html/info. php Press "I" key to edit, enter:<?phpphpinfo();? > After editing, press "ESC" key to exit edit mode, then enter:: WqThen enter, save and exit. At this point you can access your site address, such as "http://192.168.1.2/info.php", to see if you can see the relevant PHP information.
Iv. Installation Configuration phpMyAdmin
After installing Mysql,apache and PHP, we need to install phpMyAdmin for visual management of MySQL database.
4.1 Download the latest version of phpmyadmin,:http://www.phpmyadmin.net/home_page/downloads.php, select the latest version, such as phpmyadmin-3.5.2-all-languages.tar.bz2
4.2 Unpacking the Package
TAR-XVF phpmyadmin-3.5.2-all-languages.tar.bz2 |
4.3 Move directory phpmyadmin-3.5.2-all-languages to/usr/share/phpmyadmin folder (recommended manual operation, copy and paste to/usr/share/directory, after renaming file named phpMyAdmin, Using the following command line may causea 403 error when opening http://localhost/phpMyAdmin, temporarily unaware of what's going on--!)
MV Phpmyadmin-3.5.2-all-languages/usr/share/phpmyadmin |
4.4 Entering the phpMyAdmin directory
4.5 Copy the sample configuration file to the config.inc.php file
CP config.sample.inc.php config.inc.php |
4.6 Modifying the Apache configuration
vi/etc/httpd/conf.d/phpmyadmin.conf |
4.7 Write the following:
# # WEB application to manage MySQL # #<directory "/usr/share/phpmyadmin" > # Order Deny,allow # Deny from all # Allow from 127.0.0.1 #</directory> Alias/phpmyadmin/usr/share/phpmyadmin Alias/phpmyadmin/usr/share/phpmyadmin Alias/mysqladmin/usr/share/phpmyadmin |
Write and exit
4.8 Restarting the Apache server
/ETC/INIT.D/HTTPD restart |
4.9 To this point, you can easily manage your MySQL database by opening the page http://localhost/phpmyadmin
CentOS 6.3 Yum Install lamp (apache+mysql+php)