Home > Article > Backend Development > How to install mysql php on centos7
# Recommended: "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.
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-serverThe installation process is as shown below
After successful installation, use the
systemctl start mysql command to start mysql
set the root account password Use the command set password for 'root'@' localhost' =password('password');
Set up mysql remote connectionGive 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;
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
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
yum install php70w-fpm php70w-opcache
Start php-fpm
systemctl start php-fpmTest Whether php and php-fpm are installed successfully
Access your web server and the following picture will appear, indicating that the installation is successful
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!