Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install MariaDB database, PHP, and PHPMyAdmin in Centos 7

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article is about how to install MariaDB database, PHP, and PHPMyAdmin in Centos 7. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Install MariaDB database

In CentOS 7.0, MariaDB has been used instead of MySQL database, you know, after MYSQL was acquired by Oracle, the prospect is worrying, so MYSQL brother MariaDB came out to continue the open source business.

Installation:

# yum-y install mariadb-server mariadb

Start:

# systemctl start mariadb.service

# systemctl enable mariadb.service

Configure the root password below

# mysql_secure_installation

At this point, we can go on Y all the time, or we can choose according to your requirements. My choice is as follows:

At this point, even if we have finished installing the database, let's install PHP.

2. Install PHP5

Install the PHP main program:

# yum-y install php

View the php components.

# yum search php

Install PHP components to make PHP support MariaDB

# yum-y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel

It can be said that the installation is complete here, but we still have to check to see if it is successful, first build a test page index.php

First go to the html folder & check the situation in the file & create a new php page (index.php), as shown below:

Restart:

# systemctl restart httpd.service

# systemctl restart httpd

It is found that both of these can restart the httpd service.

The page is built and the httpd service is restarted, so we can take a look at the results. As shown below:

3. Install PHPMyAdmin

Because phpMyAdmin runs on the web server like other PHP programs, you can use the HTML pages generated by these programs anywhere, that is, to manage the MySQL database remotely, and to easily create, modify, and delete databases and tables. You can also use phpMyAdmin to establish a commonly used php syntax to facilitate the correctness of sql syntax needed when writing web pages, so it is necessary to install phpmyadmin.

First install the source of EPEL (be careful to select the source of CentOS7)

# rpm-ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

The above connection may be because the update is fast, so-7-5 has no, the existing is-7-9, use the above installation, prompt error, and then find the next degree Niang, also can not find the reason, can only vaguely open the above connection (delete / the last one, look for it, only to find that there is no-7-5 only-7-9, before the installation is successful. The figure below is as follows

Install and configure phpMyAdmin

# yum install phpMyAdmin

As you can see from the picture above, the installation is successful. Let's edit the files in it.

But as I said above, you must back up the files before editing, and you must get into the habit. As shown below:

After the backup, we can rest assured to operate.

# vi / etc/httpd/conf.d/phpMyAdmin.conf

We follow the above tips, comment out the relevant content, and then: wq save exit.

What needs to be done now is to change the authentication method (change cookie to http)

Vi / etc/phpMyAdmin/config.inc.php

The changes are as follows:

Because of the changes, we restart our httpd service again. The figure below is as follows

# systemctl restart httpd.service

At this point, we can set up the environment of LANP, let's enjoy the results.

Thank you for reading! This is the end of the article on "how to install MariaDB database, PHP and PHPMyAdmin in Centos 7". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report