CentOS7 installation apache+php+mariadb

Source: Internet
Author: User

First, install the Apache server

Yum Install httpd

Second, install PHP and common software packages

Yum install php httpd-manual mod_ssl mod_perl mod_auth_mysql yum install php-gd php-xml php-mbstring php-ldap php-pear
Php-xmlrpc
Yum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

Third, install MARIADB

Four, start the service

Systemctl start Httpd.service
systemctl start Mariadb.service

Five, if the fourth is successful, set two services to start automatically

Systemctl Enable Httpd.service
Systemctl enable Mariadb.service

Set up the database server

[Root@rachel ~]# mysql-u root #无密码登录数据库 Welcome to the MARIADB Monitor. Commands End With;
or \g. Your mariadb Connection ID is 3 server version:5.5.44-mariadb mariadb server Copyright (c), 2015, Oracle, MARIADB C

Orporation Ab and others. Type ' help, ' or ' \h ' for help.

Type ' \c ' to clear the current input statement. MARIADB [(None)]> Select User, host, password from Mysql.user; #检索数据库用户 +------+--------------+----------+ | user | Host |
password | +------+--------------+----------+
| Root |          localhost | |
| Root |          Rachel | |
| Root |          127.0.0.1 | |
| Root |          :: 1 |      |
| |          localhost |      |
| |          Rachel |
|
+------+--------------+----------+ 6 rows in Set (0.00 sec) mariadb [None]]> delete from mysql.user where user= '; Query OK, 2 rows Affected (0.00 sec) #删除匿名用户 mariadb [(none)]> Delete from mysql.user where user= ' root ' and host= ':: 1 ' ; #删除IPv6方式登录用户 Query OK, 1 row affecTed (0.00 sec) Mariadb [(None)]> Select User, host, password from Mysql.user; #再次查看用户 +------+--------------+----------+ | user | Host |
password | +------+--------------+----------+
| Root |          localhost | |
| Root |          Rachel | |
| Root |          127.0.0.1 |
| +------+--------------+----------+ 3 rows in Set (0.00 sec) mariadb [None]]> set password for Root@localhost=password  (' XXXXXX ');  #修改本地登录密码 Query OK, 0 rows Affected (0.00 sec) mariadb [None]]> set password for Root@rachel=password (' XXXXXX ');   #修改本地登录密码 Query OK, 0 rows Affected (0.00 sec) mariadb [None]]> set password for root@ ' 127.0.0.1 ' =password (' XXXXXX '); #修改本地登录密码 Query OK, 0 rows Affected (0.00 sec) mariadb [None]]> Select User, host, password from Mysql.user; #查看密码 +------+--------------+-------------------------------------------+ | user | Host |
password | +------+--------------+-------------------------------------------+
| Root | localhost | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root | Rachel | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root | 127.0.0.1 |
*1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | +------+--------------+-------------------------------------------+ 3 rows in Set (0.00 sec) Mariadb [(None)]> Exit #  Exit Bye [Root@rachel ~]# mysql-u root-p #再次用密码登录测试 Enter password:welcome to the MARIADB Monitor. Commands End With;
or \g. Your mariadb Connection ID is 4 server version:5.5.44-mariadb mariadb server Copyright (c), 2015, Oracle, MARIADB C

Orporation Ab and others. Type ' help, ' or ' \h ' for help.

Type ' \c ' to clear the current input statement. MARIADB [(None)]> exit Bye [Root@rachel ~]# #测试成功

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.