search
HomeBackend DevelopmentPHP ProblemHow to install mysql php on centos7

How to install mysql php in centos7: first download and install mysql-server from the official website; then use the "systemctl start mysql" command to start mysql; then use the yum command to install php7; finally install and start php-fpm.

How to install mysql php on centos7

# Recommended: "

PHP Video Tutorial

Official website download and install mysql-server

Use the following three commands to install in sequence

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

The installation process is as shown below

How to install mysql php on centos7

How to install mysql php on centos7

How to install mysql php on centos7

After successful installation, use the

systemctl start mysql command to start mysql

How to install mysql php on centos7

As can be seen from the above picture, the initial installation of mysql root account does not have a password

Let’s

set the root account password Use the command set password for 'root'@' localhost' =password('password');

As shown below, we set the root account password to 123456 and logged in successfully

How to install mysql php on centos7

How to install mysql php on centos7

Set up mysql remote connection

Give all database permissions to the root account

grant all privileges on *.* to root@'%'identified by 'password';

If it is a new user instead of root, you must first create a new user

create user 'username'@'%' identified by 'password';

Flush privileges

flush privileges;

How to install mysql php on centos7

This way our mysql database is configured and we can connect remotely


Download php7

    Install php7
  • rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

How to install mysql php on centos7

##Use yum command to install php7
  • yum install php70w.x86_64 php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-mysql.x86_64 php70w-pdo.x86_64

How to install mysql php on centos7

Install php-fpm and start
  • yum install php70w-fpm php70w-opcache

How to install mysql php on centos7Start php-fpm

systemctl start php-fpm

Test Whether php and php-fpm are installed successfully
  • Create a new index.php in the nginx root directory with the following content

How to install mysql php on centos7

How to install mysql php on centos7Access your web server and the following picture will appear, indicating that the installation is successful

How to install mysql php on centos7

The above is the detailed content of How to install mysql php on centos7. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version