CentOS configuration apache+mysql+php (Yun) with uninstall

Source: Internet
Author: User
Tags install php php mysql

First, install the Apache2
#yum-y Install httpd

Installation configuration complete, start httpd service
#service httpd Start

Second, install MySQL
1. Install MySQL
#yum-y Install Mysql-server

When the installation is complete, start the MySQL service:
#service mysqld Start

2. Configure the password for the root of MySQL super User:
#usr/bin/mysqladmin-u root password ' 123456 '

Use the command to test for the correct password after you modify it:
#mysql-U root-p123456

3. Set the default database encoding, log in to MySQL with the root user, enter status to view the default settings:
mysql>status;
Server Characterset:utf8
Db Characterset:utf8
Client characterset:latin1
Conn. Characterset:latin1


Modify the UTF8 encoding for all:
#vi/etc/my.cnf
Add after [MYSQLD] Block: Default-character-set=utf8
Add after [MySQL] block: Default-character-set=utf8
If [MySQL] can add itself at the end, then add the character encoding statement.

Sometimes found in this file only [mysqld] and [Mysqld_safe], can be added at the end

[Client]

Default-character-set=utf8

Then restart service mysqld stop

Service mysqld Start

Third, install PHP

#yum-y Install PHP

Iv. Configuring additional extension components


The following installation includes PHP MySQL and GD extensions are often used, be sure to install, the other can choose to install
#yum-y install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

Install the above content, restart Apache, check the test page output information to see if the configuration is correct.

uninstalling Apache MySQL PHP
In fact, like uninstalling other software (the Yum method is installed):
Yum-y Remove httpd
Yum-y Remove httpd*
Yum-y Remove Mysqld
Yum-y Remove mysqld*
Yum-y Remove PHP
Yum-y Remove PHP-GD
Yum-y Remove MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.