CentOS7 安装 玛丽亚DB

本身在网上搜了不少连锁资料,然后自身开展了一下结合,把重复的铲除,不重复的拔取性获取过滤,整合完了今后在当地虚拟机上尝试搭建了下,很顺遂的搭建成功。

CentOS7 安装 MariaDB

CentOS7上述版本上,不再行使MySQL数据库,而是选取玛丽亚DB数据库,其中玛丽亚DB是MySQL的一个分支.现在写上个人在CentOS7里设置配备玛丽亚DB的步调:

  1. 下载安装玛丽亚DB

**yum -y install mariadb-server mariadb

  1. 启动玛丽亚DB,并设置root用户的密码:

#启动MariaDB服务
**

[[email protected]
/]# systemctl start mariadb

#设置MariaDB开机默许启动
[[email protected]
/]# systemctl enable mariadb

ln -s ‘/usr/lib/systemd/system/mariadb.service’
‘/etc/systemd/system/multi-user.target.wants/mariadb.service’

#测试是或不是中标启动
[[email protected]
/]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input
statement.

#翻看默许安装了什么样数据库
MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
| test |
+——————–+
4 rows in set (0.00 sec)

#退出
MariaDB [(none)]> exit
Bye

#在生养环境里安装完后,提出一定要运行几回mysql_secure_installation安全计划向导
[[email protected]
/]# mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client:
command not found

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.

#是因为一早先设置玛丽亚DB数据库后, root用户默许密码为空,
所以只需要按Enter键
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.

#是否设置root用户的新密码

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.

#是或不是禁止root远程登录,根据本人的须求选用
Disallow root login remotely? [Y/n] n
… skipping.

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.

#是还是不是删除test数据库
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!

#六盘水设置已毕后,测试使用root用户登录操作
[[email protected]
/]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 5.5.47-MariaDB MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input
statement.

MariaDB [(none)]> show databases;
+——————–+
| Database |
+——————–+
| information_schema |
| mysql |
| performance_schema |
+——————–+
3 rows in set (0.00 sec)

安装 玛丽亚DB
CentOS7上述版本上,不再选择MySQL数据库,而是利用玛丽亚DB数据库,其中玛丽亚DB是MySQL的一个分支.现在写上个人在CentOS7里设置配置…

LAMP网站服务器是Linux、
Apache、MySQL、PHP的简写。在Linux系统上安装apache服务器不是一件难事,因为差不离主流的Linux发行版本软件库都席卷了要设置的软件,本文将向咱们体现在Fedora
20系统上哪些设置Apache2 web服务,PHP5 (mod_php)和 MySQL 数据库

LAMP是Linux+apache+MySQL+PHP的缩写。本课程演示怎么样设置在一台CentOS
5.6与PHP5(mod_php)和MySQL数据库加Apache2 web服务器。
1.始发表明
在本教程中应用的主机名为server1.example.com,IP地址192.168.0.100。那么些设置只怕与你的设置分化,所以您不大概不在合适意况下更换。
2.安装MySQL 5.0
打开终端输入:
yum install mysql mysql-server
输入以下命令,让mysql数据库伴随系统活动启动:
chkconfig --levels 235 mysqld on/etc/init.d/mysqld start
设置MySQL的root帐户密码:
mysql_secure_installation
电脑终端展现,按提醒操作:

虚拟机:win10系统自带的虚构机Hyper-v(虚拟机都差不离)

或然有不正确的地方,希望我们指正!

[root@server1 ~]# mysql_secure_installation

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

In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, 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 MySQL
root user without the proper authorisation.

Set root password? [Y/n] <–
回车
New password: <– 你的root密码
Re-enter new password: <–
再输入三次root密码
Password updated successfully!
Reloading privilege tables..
… Success!

By default, a MySQL installation has an anonymous user, allowing
anyone
to log into MySQL 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] <–
回车
… 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] style=”COLOR: #ff0000″><– 回车
… Success!

By default, MySQL 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] style=”COLOR: #ff0000″> <– 回车

  • 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] style=”COLOR: #ff0000″><– 回车
… Success!

Cleaning up…

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

Thanks for using MySQL!

[root@server1 ~]#

Linux系统:centos7

1 安全前提示:

本文使用的主机名为:server1.example.com ,IP地址为 192.168.0.100。这么些须求按照你的主机意况作相应修改!

3.安装Apache2
CentOS已经封装了apache2,使用直接在顶峰输入安装:
yum install httpd
安顿序列并启动apache:
chkconfig --levels 235 httpd on
启动apache:
/etc/init.d/httpd start
近年来浏览器输入IP地址,看看是或不是运行:

引进先在虚拟机中测试了未来,再在服务器上搭建环境。

2 安装数据库,有五个数据库可选:MySQL/玛丽亚DB 5

运用上面的吩咐安装MySQL:

yum install mysql mysql-server

为MySQL创设启动连接 (那样 MySQL 将随系统活动启动)并启动 MySQL服务:

systemctl enable mysqld.service

在意:借使你收到这么的荒谬

Failed to issue method call: No such file or directory

运用上边的下令

systemctl enable mariadb.service

尤其启动mysql的劳务

systemctl start mysqld.service

运行

mysql_secure_installation

安装root用户密码(否则任什么人都足以访问你MySQL数据库!):

[root@server1 ~]#
mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client:
command not found

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] <– (直接回车)
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] <– (直接回车)
… 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] <– (直接回车)
… 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] <– (直接回车)

  • 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] <– (间接回车)
… 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!
[root@server1 ~]#

图片 1

一、安装虚拟机

3 安装Apache2服务器

运行下边的通令:

yum install httpd

现在布局您的种类在开机时起步Apache…

systemctl enable httpd.service

而且启动Apache:

systemctl start httpd.service

在浏览器输入地方访问

图片 2

证实:在CentOS中Apache的默许根目录是/var/www/html,配置文件/etc/httpd/conf/httpd.conf。其余布置存储在/etc/httpd/conf.d/目录。

二、安装CentOS7

————————————–分割线

Ubuntu 13.04 安装
LAMP\Vsftpd\Webmin\phpMyAdmin 服务及安装

http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS
5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12)
http://www.linuxidc.com/Linux/2013-03/80333p3.htm

RedHat
5.4下Web服务器架设之源码打造LAMP环境及利用PHPWind
http://www.linuxidc.com/Linux/2012-10/72484p2.htm

LAMP源码环境搭建WEB服务器Linux+Apache+MySQL+PHP
http://www.linuxidc.com/Linux/2013-05/84882.htm

LAMP+Xcache 环境搭建
http://www.linuxidc.com/Linux/2014-05/101087.htm

————————————–分割线
————————————– 

在Fedora系统中Apache默许根目录为 /var/www/html ,配置文件地方: /etc/httpd/conf/httpd.conf。其他安插文件目录
/etc/httpd/conf.d/。

更多详情见请继续读书下一页的美丽内容
http://www.linuxidc.com/Linux/2014-05/101266p2.htm

图片 3

4.安装PHP5
设置PHP5和Apache PHP5模块如下命令:
yum install php
重复开动Apache
/etc/init.d/httpd restart
5.测试PHP5并得到有关PHP5安装细节
在web服务器成立phpinfo文档:
vi /var/www/html/info.php
累加如下代码,因为这一个是函数,在wordpress里面回运行,所以您须求把双引号改为单引号:

注意:以下安装,我都是用的root权限。

《?php
phpinfo();

三、安装Apache
1.安装
yum -y install httpd
2.开启apache服务
systemctl start httpd.service
3.设置apache服务开机启动
systemctl enable httpd.service
4.验证apache服务是还是不是安装成功
在本机浏览器中输入虚拟机的ip地址,假如见到apache默许的页面–有Testing
123…字样,便是旗开得胜安装了apache服务了。

明天在浏览器中输入

CentOS7查看ip地址的方法为:
ip addr
访问应该是败退的,原因如下:
查了材料,说法是,CentOS7用的是Firewall-cmd,CentOS7之前用的是iptables防火墙;要想让外网能访问到apache主目录,就须求做以下的操作:
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
下一场再拜访外网ip,就足以了。

图片 4

四、安装PHP
1.安装
yum -y install php
2.重启apache服务
systemctl restart httpd或者systemctl restart httpd.service
下一场,你可以写一个php文件在浏览器中运行一下了;
eg:
vi /var/www/html/info.php
i
<?php phpinfo(); ?>
Esc
:wq
接下来,在协调电脑浏览器输入 10.17.1.223/info.php
运转,会现出php的部分新闻

一经您见到如上截图,PHP5工作正常,继续向下滚动,看看您曾经启动的PHP5模块。MySQL是一直不列出,那表示大家有没有在PHP5中添加MySQL模块支持。

发表评论

电子邮件地址不会被公开。 必填项已用*标注