首先简单介绍一下什么叫MySQL;
数据库简而言之就是存储数据的仓库,为了方便数据的存储和管理,它将数据按照特定的规律存储在磁盘上。是为了实现一定的目的,按照某种规则组织起来的数据的集合;
MySQL是一种开放源代码的关系型数据库管理系统(RDBMS),使用最常用的数据库管理语言--结构化bai查询语言(SQL)进行数据库管理。通过数据库管理系统,可以有效的组织和管理存储在数据库中的数据。
那么我们常见的数据库模型:
1,关系型数据库
MySql
Oracle
SQL Server
2,非关系型数据库
2,1文档存储数据库 MongDB
2,2键值存储数据库 Redis Memcached
2,3列存储数据库 HBase
2,4图形数据库 Neo4J
关于数据库在公司面试的题目都有那些呢?
1,SQL语句操作数据库
2,SQL语句操作表结构
3,表和类之间的关系 字段和属性之间的关系
表对应的是java中的类,用来存储数据库中取出的数据
字段名(列)和类中的成员变量属性一致
表中的行根据类创建的对象
3,SQL语句的介绍:
MySql不认识java,那么就需要交互,需用到数据库认识的语言
SQL语句是数据代码库
一丶环境
虚拟机: centos7
MYSQL:mysql-8.0.23-1.el7.x86_64.rpm-bundle
①首先要去把MySQL安装包下好
MySQL官网:https://www.mysql.com/
①丶

②丶

③丶

④丶

⑤丶

按照以上步骤就将mysqi压缩包下载到电脑上了
二丶下面打开虚拟机并且使用远程工具xshell连接&CRT连接。
我这里使用xshell
xshell6下载包
链接: https://pan.baidu.com/s/1MceOl8oqmVEXUK_szjnXRg
提取码: 9nqz
虚拟机这里就不介绍了,网上有很多安装虚拟机的方法
①丶打开虚拟机然后就不用管了;

②丶直接打开xshell输入IP创建远程连接

③丶输入用户密码

④丶登录成功

三丶正菜开始
通过rpm -qa | grep mariadb 命令查看mariadb 的安装包

②丶再通过命令 rpm -e mariadb-libs-5.5.56-2.el7.x86_64 --nodeps 卸载mariadb

③丶再通过rpm -qa | grep mariadb查看mariadb

④丶通过cd /usr/local/ 命令进入根目录下的usr目录下的local目录,这个目录是放一些本地的共享资源的

⑤丶通过ll查看一下目录结构

⑥丶通过mkdir mysql 命令 在当前目录下创建一个名为 mysql 的目录,并且ll查看一下新建的mysql目录
R丶通过以下命令启动设置防火墙
systemctl enable iptables;
systemctl start iptables;

S丶通过 vim /etc/sysconfig/iptables 命令编辑防火墙,添加端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8090 -j ACCEPT

U丶通过systemctl restart iptables.service 命令重启防火墙使配置生效

V丶通过systemctl enable iptables.service 命令设置防火墙开机启动

W丶通过ifconfig 命令查看 ip

X丶新建SQLyog 的连接
SQLyog的包
链接: https://pan.baidu.com/s/1MceOl8oqmVEXUK_szjnXRg
提取码: 9nqz

Y丶连接成功

Z丶使用命令show databases;查看所有的数据库

MySQL安装是完了 ,不过这才刚开始 增删改查命令还多着呢 加油。
到此这篇关于Centos7下安装MySQL8.0.23的步骤(小白入门级别)的文章就介绍到这了,更多相关Centos7安装MySQL8.0.23内容请搜索社区以前的文章或继续浏览下面的相关文章希望大家以后多多支持社区! |