安装MariaDB phpMyAdmin

1 安装设置MariaDB5.5

[[email protected] ~]# yum -y install mariadb-server

[[email protected] ~]# vi /etc/my.cnf
[mysqld]

character-set-server=utf8

[[email protected] ~]# systemctl enable  mariadb.service
[[email protected] ~]# systemctl start  mariadb.service

[[email protected] ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we‘ll need the current
password for the root user.  If you‘ve just installed MariaDB, and
you haven‘t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

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

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

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

Normally, root should only be allowed to connect from ‘localhost‘.  This
ensures that someone cannot guess at the root password from the network.

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

By default, MariaDB comes with a database named ‘test‘ that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

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

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

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

Cleaning up...

All done!  If you‘ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

2 安装设置httpd

[[email protected] ~]# yum -y install httpd

[[email protected] ~]# rm -f /etc/httpd/conf.d/welcome.conf
[[email protected] ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
[[email protected] ~]# systemctl start httpd
[[email protected] ~]# vi /var/www/html/index.html

<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>

直接访问网页

3 安装设置PHP

[[email protected] ~]#  yum -y install php php-mbstring php-pear

[[email protected] ~]# vi /etc/php.ini
date.timezone ="Asia/ShangHai"

[[email protected] ~]# systemctl restart httpd

[[email protected] ~]# vi /var/www/html/index.php

<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
<?php
   print Date("Y/m/d");
?>
</div>
</body>
</html>

4 安装设置phpMyAdmin

[[email protected] ~]# yum --enablerepo=epel -y install phpMyAdmin php-mysql php-mcrypt

[[email protected] ~]# vi /etc/httpd/conf.d/phpMyAdmin.conf

<IfModule mod_authz_core.c>
     15      # Apache 2.4
     16      <RequireAny>
     17        Require ip 127.0.0.1 9.110.187.100/24
     18        Require ip ::1
     19      </RequireAny>
     20    </IfModule>
     21    <IfModule !mod_authz_core.c>
     22      # Apache 2.2
     23      Order Deny,Allow
     24      Deny from All
     25      Allow from 127.0.0.1
     26      Allow from ::1
     27    </IfModule>
     28 </Directory>
     29
     30 <Directory /usr/share/phpMyAdmin/setup/>
     31    <IfModule mod_authz_core.c>
     32      # Apache 2.4
     33      <RequireAny>
     34        Require ip 127.0.0.1 9.110.187.100/24
     35        Require ip ::1
     36      </RequireAny>
     37    </IfModule>

[[email protected] ~]# systemctl restart httpd

时间: 2024-10-23 20:36:43

安装MariaDB phpMyAdmin的相关文章

Centos 7 安装 Wordpress(三)-----安装 MariaDB数据库、PHP & PHPMyAdmin

全文根据 Keneuro的博客来安装,所以也把该地址分享出来. ----------------------------------------------------------------------------- 下面咱们也来试下. 先来试下 Centos 7 安装 Wordpress(三)-----安装 MariaDB数据库.PHP & PHPMyAdmin

centos7 安装mariaDB 以及 phpmyadmin的安装

一:安装mariadb, mariadb 是 mysql 的一个分支,基本和mysql一样的 1. yum -y install mariadb-server 2. vi /etc/my.cnf.d/server.cnf 在第13行添加 character-set-server=utf8 3.启动mariadb服务 service mariadb start systemctl enable mariadb 4: 配置 mariadb mysql_secure_installation 设置 m

CentOS 7 / RHEL 7 上安装 LAMP + phpMyAdmin

原文 CentOS 7 / RHEL 7 上安装 LAMP + phpMyAdmin 发表于 2014-11-02 作者 Haoxian Zeng 更新于 2014-12-12 之前根据在 Linode VPS 上部署 LAMP 服务器的经验写了安装记录,得到不少网友的亲睐.随着 CentOS 7 发布,安装过程发生了不少变化.因此在虚拟机上跑了一下,根据之前的记录做了修改,以供参考.主要注意的是,现在数据库由 MySQL 改成 MariaDB 了,故而 LAMP 代表的就是 Linux + A

Docker容器里部署Apache+PHP+MariaDB+phpMyAdmin

前面讲到了创建MariaDB,这次在前面的基础上搭建phpMyAdmin服务,以便友好的管理数据库MariaDB.MariaDB的docker独立出来,这样方便管理,易于扩展.这次我们基于Dockerfile方式创建剩余的服务,Dockerfile也是官方推荐的创建镜像方法. 创建Apache+PHP+phpMyAdmin镜像 首先启动MariaDB的容器 在上一节中我们知道数据库的用户名是root,密码是123456,但是我们还缺少数据库的ip地址,我们使用如下方法获取docker实例的ip地

Linux安装MariaDB和简单配置

1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start mariadb 设置开机启动 systemctl enable mariadb 接下来进行MariaDB的相关简单配置 mysql_secure_installation 首先是设置密码,会提示先输入密码 Enter current password for root (enter for none):<–初

Centos7安装mariadb galera cluster数据库集群 & 详解

#Galera集群特点 集群之间无延时,同步复制.而master-slave主从异步复制,存在延迟. active-active多主,集群内部服务器都是同时写,必须等所有集群内所有数据库都完成数据写入,才会反馈完成,所以不存在数据丢失的情况. 集群节点自动故障转移,如果集群中单个节点故障,失效节点会自动被清除. 扩展方便,只要将新的节点添加到集群,新节点自动复制数据. #Galera集群原理     #主要通过galera插件保证数据的一致性,该数据复制的过程是可认证的复制,原理如下: #解析

用yum安装mariadb

当前系统:centos7.1mini 在/etc/yum.repos.d/MariaDB.repo添加MariaDB yum源 [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 安装mariadb: yum install MariaDB-server MariaDB-c

CentOS编译安装MariaDB 及系统初始化

编译安装MariaDB 注意:MariaDB的编译安装方式与MySQL相同 1.准备生产环境中数据目录(逻辑卷)   # fdisk /dev/sda 创建一个逻辑分区/dev/sda6   创建逻辑卷 #pvcreate /dev/sda6 #vgcreate myvg /dev/sda6 #lvcreate -L 10G -n mydata /dev/myvg 格式化逻辑卷 #mke2fs -t ext4 /dev/myvg/mydata   创建数据目录 #mkdir -pv /mydat

centos通过yum方式和二进制包安装mariadb

centos7.3通过yum方式安装mariadb 通过安装包组的方式安装 yum groupinfo mariadb mariadb-client yum groupinstall mariadb mariadb-client 启动服务,第一次启动时间有点长 systemctl start mariadb systemctl status mariadb systemctl enable mariadb 安全策略设置,设置密码等 mysql_secure_installation 查看tcp