CentOS7 installation apache+php+mariadb

Source: Internet
Author: User
First, install ApacheServer

install httpd

Second, install PHP and common software packages

yum install php httpd-manual mod_ssl mod_perl mod_auth_mysqlyum install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpcyum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql

Third, install MARIADB

install

Iv. Start the service

start httpd.servicesystemctl start mariadb.service

Five, if the fourth succeeds, set up two services to start automatically

systemctl enable httpd.servicesystemctl enable mariadb.service

VI, set up the database server

[Root@rachel ~]# mysql-u Root #无密码登录数据库Welcome to theMariaDB Monitor. CommandsEnd with;or\g.your MariaDB ConnectionID is3Serverversion:5.5. the-MARIADB MariaDB Servercopyright (c) -, -, Oracle, MariaDB Corporation Ab andOthers. Type ' help; 'or' \h ' forHelp. Type ' \c ' toClear theCurrent input statement. MariaDB [(None)]> Select User, host, password fromMysql.user;#检索数据库用户+------+--------------+----------+| user | Host | Password |+------+--------------+----------+| Root |          localhost | || Root |          Rachel | || Root |127.0. 0. 1| || Root | ::1|      || |          localhost |      || |          Rachel | |+------+--------------+----------+6RowsinchSet(0.00SEC) MariaDB [(none)]> Delete fromMysql.userwhereUser= "; Query OK,2Rows Affected (0.00Sec#删除匿名用户MariaDB [(none)]> Delete fromMysql.userwhereUser= ' Root ' andHost= '::1';#删除IPv6方式登录用户Query OK,1Row affected (0.00SEC) MariaDB [(None)]> Select User, host, password fromMysql.user;#再次查看用户+------+--------------+----------+| user | Host | Password |+------+--------------+----------+| Root |          localhost | || Root |          Rachel | || Root |127.0. 0. 1| |+------+--------------+----------+3RowsinchSet(0.00SEC) MariaDB [(None)]>SetPassword forRoot@localhost=password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]>SetPassword forRoot@rachel=password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]>SetPassword forroot@ '127.0. 0. 1' =password (' XXXXXX ');#修改本地登录密码Query OK,0Rows Affected (0.00SEC) MariaDB [(None)]> Select User, host, password fromMysql.user;#查看密码+------+--------------+-------------------------------------------+| user | Host | Password |+------+--------------+-------------------------------------------+| Root | localhost | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root | Rachel | *1728fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx | | Root |127.0. 0. 1| *1728Fcc102d8d1eb12bfxxxxxxxxxxxxxxxxxxx |+------+--------------+-------------------------------------------+3RowsinchSet(0.00SEC) MariaDB [(None)]>Exit#退出Bye[root@rachel ~]# mysql-u Root-p #再次用密码登录测试Enter Password:welcome to theMariaDB Monitor. CommandsEnd with;or\g.your MariaDB ConnectionID is4Serverversion:5.5. the-MARIADB MariaDB Servercopyright (c) -, -, Oracle, MariaDB Corporation Ab andOthers. Type ' help; 'or' \h ' forHelp. Type ' \c ' toClear theCurrent input statement. MariaDB [(None)]>ExitBye[root@rachel ~]# #测试成功

The above describes the CentOS7 installation apache+php+mariadb, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.