端くれプログラマの備忘録 ホスティング [ホスティング] MySQL、PHP、phpMyAdminのインストール (CentOS 7.1)

[ホスティング] MySQL、PHP、phpMyAdminのインストール (CentOS 7.1)

MySQL (MariaDB)

$ sudo yum install mariadb-server mariadb
$ sudo systemctl start mariadb
$ sudo mysql_secure_installation
Enter current password for root (enter for none):

Set root password? [Y/n]
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!

Remove anonymous users? [Y/n]
... Success!

Disallow root login remotely? [Y/n]
... Success!

Remove test database and access to it? [Y/n]
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reload privilege tables now? [Y/n]
... Success!

$ sudo systemctl enable mariadb.service

PHP

$ sudo yum install php php-mysql
$ sudo systemctl restart httpd.service

phpMyAdmin

$ sudo yum install epel-release
$ sudo yum install phpmyadmin
$ sudo vi /etc/httpd/conf.d/phpMyAdmin.conf
Require ip <アクセス元IP>
Allow from <アクセス元IP>
$ sudo systemctl restart httpd.service

確認: http://サーバーIP/phpMyAdmin