1. 配置CentOS 7的防火墙

  • CentOS 7 默认使用的防火墙是firewall,开启TCP端口80:
    [root@localhost ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent
  • 重新启动防火墙让更改立刻生效:
    [root@localhost ~]# firewall-cmd --reload
  • 检查端口是否开放:
    [root@localhost ~]# firewall-cmd --list-all
  • 查看firewall服务状态:
    [root@localhost ~]# firewall-cmd --state

补充:

  • systemctl --failed :检查加载失败的服务
  • systemctl status network :查看网络服务状态
  • systemctl stop firewalld.service : 关闭firewalld防火墙
  • systemctl disable firewalld.service : 禁止firewalld开机启动
  • systemctl start firewalld.service : 开启firewalld防火墙
  • systemctl restart firewalld.service : 重启firewalld防火墙

2.使用links来浏览网站

  • 安装links工具: yum install links 安装过程中,遇到选项,一路y即可。

    如:links localhost 或者 links www.baidu.com

3.安装Apache HTTP服务器

  • 安装 Apache HTTP # yum install httpd


  • 允许HTTP服务通过防火墙

    # firewall-cmd --add-service=http

  • 永久添加HTTP服务配置

    # firewall-cmd --add-service=http --permanent

  • 重新加载防火墙

    # firewall-cmd --reload

  • 重启Apache HTTP服务器

    # systemctl restart httpd.service

    将Apache服务添加到系统,随系统自动启动
    # systemctl start httpd.service
    # systemctl enable httpd.service

  • 通过links 命令验证Apache HTTP 服务器

    # links 127.0.0.1


Ctrl+z 退出界面

4.安装mysql

1) [root@localhost ~]# yum install mysql-server

Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfile* hase: mirrors.sina.cn* extras: mirrors.sina.cn* updates: mirrors.sina.cn
No package mysql-server available.
Error: Nothing to do

经查CentOS 7 版本将MySQL数据库软件从默认的程序列表中移除,用mariadb代替了。

MariaDB 是 MySQL 的一个分支。RHEL 以及它的衍生版已经从 MySQL 迁移到 MariaDB。这是一个主流的数据库管理系统。在最小化安装的 CentOS 上安装 MariaDB,如下所示:
[root@localhost ~]# yum install mariadb-server mariadb

mariadb数据库的相关命令是:
systemctl start mariadb  #启动MariaDB
systemctl stop mariadb  #停止MariaDB
systemctl restart mariadb  #重启MariaDB
systemctl enable mariadb  #设置开机启动
所以先启动数据库
[root@localhost ~]# systemctl start mariadb

然后就可以正常使用mysql了

[root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 5.5.41-MariaDB MariaDB Server  Copyright (c) 2000, 2014, 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)]>  

2) 下载mysql进行安装

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

安装成功后重启mysql服务。
# service mysqld restart
初次安装mysql,root账户没有密码。

[root@yl-web yl]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.37 MySQL Community Server (GPL)Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.01 sec)mysql> 

设置密码

mysql> set password for 'root'@'localhost' =password('password');
Query OK, 0 rows affected (0.00 sec)mysql> 

不需要重启数据库即可生效。

查看mysql字符集配置:

mysql>show variables like 'character%'

mysql配置文件为/etc/my.cnf
最后加上编码配置

[mysqld]
character_set_server = utf8

字符编码必须和/usr/share/mysql/charsets/Index.xml中保持一致。

把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。

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

如果不是root用户,则要先新建用户

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

查看安装的软件:

[root@localhost ~]# yum list installed | grep mysql

[root@localhost ~]# rpm -qa | grep -i mysql

转载于:https://www.cnblogs.com/isxt/p/7396416.html

VMware的CentOS部署环境相关推荐

  1. centos losf 安装_Linux Centos7部署环境安装-CentOS

    Linux Centos7部署环境安装-CentOS Centos7部署环境安装及Linux常用命令 centos系统下各文件夹的作用 centos7修改系统默认语言 centos7安装rz/sz命令 ...

  2. 云原生之使用docker部署centos系统测试环境

    云原生之使用docker部署centos系统测试环境 一.检查本地服务器系统版本 二.检查docker版本 三.检查docker状态 四.下载centos镜像 五.创建centos容器 1.运行cne ...

  3. linux系统(Centos 7)部署环境记录(显卡驱动、CUDA、CuDnn和conda环境安装)

    1.centos7 联网 一般应该是直接连上网线就能用,我用的园区有线网络,需要配置ipv4网址和个人账户登陆,我的wifi连接有问题. 上面的设置完了基本就能使了,有网络安装东西或查阅资料都很方便. ...

  4. CentOS 8环境下GitBlit安装部署

    目录: 一.安装jdk 二.GlitBli搭建 三.Git搭建 阅读本文前建议先阅读另一篇关于Windows环境下的GitBlit部署,之后在Linux上会熟练很多哦(⊙o⊙).传送门:Windows ...

  5. 利用VMware搭建centos环境

    1.安装VMware http://2t6y.mydown.com/tianji/f689.shtml?sfrom=166&keyID=123479 2.下载centos https://ww ...

  6. 从零学ELK系列(二):VMware安装Centos(超详细图文教程)

    [前言] 最近在研究ELK日志收集架构,想搭一套环境收集自己项目的日志:需要Linux环境支持,自己在阿里云的服务器由于部署了自己的自有博客系统(https://zhanghan.xin),资源不充足 ...

  7. linux基础-vmware与Centos安装

    安装方式 想学Linux,如何安装才是正确的方式呢. pc可以选择 -纯系统 Linux或者windows -双系统 Windows+Linux -虚拟化技术 Windows+vmware works ...

  8. ESXi6.5环境搭建(一:VMware Workstations 12 Pro 环境的安装及配置)

    实验目的及要求 完成VMware workstations安装,会应用相关操作: 完成虚拟机中ESXI6.5平台的安装及网络环境配置: 完成VMware vSphere Client 6.0软件在PC ...

  9. vagrant --- vagrant部署环境

    vagrant --- vagrant部署环境 你是否也想在自己的笔记本上搭个集群做一系列的练习,你是不是经常为开发环境没问题的代码在测试环境下都出现一堆问题而苦恼,你是不是还因为虚拟机太占用笔记本资 ...

  10. Teradata天睿公司推出适用各种部署环境的全球最强分析数据库

    Teradata天睿公司(Teradata Corporation,纽交所:TDC)推出Teradata Everywhere™,成为业内首家在多种公有云.托管云和本地部署环境下部署全球最强海量并行处 ...

最新文章

  1. springboot 订单重复提交_Spring Boot (一) 校验表单重复提交
  2. Unable to execute dex: Multiple dex files define Landroid/support/v4/app/ActivityCompatHoneycomb;
  3. Altium Designer类的使用
  4. POJ1177矩形面积并(矩形切割+括号匹配)
  5. (11) ejb学习: Jpa事务管理类型 container 和 bean
  6. c语言多线程面试题,iOS面试题--网络多线程
  7. 【嵌入式实验】《ARM汇编与接口设计》
  8. atitit.提升开发效率---使用server控件生命周期 asp.net 11个阶段 java jsf 的6个阶段比較...
  9. 怎么让百度收录站点的图片呢?
  10. 机器学习、神经网络、深度学习的关系
  11. ManualResetEvent类的用法
  12. java画图工具_java画图板工具
  13. 智慧营区解决方案-最新全套文件
  14. Filament 渲染引擎剖析 之 创建渲染对象 1
  15. 内含18禁~~关于自学\跳槽\转行做网络安全行业的一些建议
  16. webview加载gif图片
  17. 特警把那盅犯形容的汝么厉害
  18. 视频内容相似度视频数字版权 综述
  19. python modis数据拼接_Python批处理MODIS_NDVI数据
  20. (八)、管理向基于模型的设计的转变

热门文章

  1. JNI:需要显式指定使用jar的全路径
  2. 迅雷极速与旋风的对比
  3. 快速安装Pytorch
  4. 如何删除win10的windows.old
  5. python余弦定理求角_余弦定理计算文章相似度
  6. vs 配置 .pdb
  7. ondestroy什么时候调用_程序员最害怕的是什么—函数
  8. python深度神经网络_深度神经网络 (第七部分)。 神经网络的融合: 堆叠
  9. 俄勒冈州立大学计算机科学专业,美国俄勒冈州立大学专业介绍
  10. [C/C++] C++笔试常见问题