/ 2019-06-18
数据:文字、图片、视频。。。人类认知的数据表现方式
计算机:二进制、16进制的机器语言
基于数据的重要性和复杂性的不同,我们可能有不同的管理方式。
哪些数据是适合存储到数据库的呢?
重要性比较高的
关系较复杂的数据
RDBMS: 关系型数据库管理系统
比较适合于,安全级别要求高的数据以及关系较复杂的数据
NoSQL:非关系型数据库管理系统
适合于高性能存取数据,一般是配合RDBMS进行使用的
针对大数据处理分析,分布式架构更加擅长
RDBMS :
MySQL 、Oracle、MSSQL(SQL Server)、PG
NoSQL:Not Only SQL
键-值(key-value):Redis, memcached
文档(document):Mongodb
5.6
5.7
8.0(现在开始研究新特性)
Oracle:
MySQL官方版
红帽 :
MariaDB
Percona:
PerconaDB
1.一般选择官方主流版本:5.6,5.7
2.GA(稳定发布版)
3.6-12月的产品版本
5.7.20 二进制安装,其他安装方式自己扩展
4.5 如何获取MySQL软件
企业版:Enterprise , 互联网行业一般不选择.
社区版本:选择
源码包:source code .tar.gz
通用二进制
面试题:
你们公司用什么版本数据库? 具体什么小版本号?
5.6.20 5.6.34 5.6.36 5.6.38 5.6.40
5.7.18 5.7.20 5.7.22
[root@db01 ~]# mkdir -p /app/
上传软件到此目录
[root@db01 app]# mv mysql-5.7.20-linux-glibc2.12-x86_64 mysql
[root@db01 app]# ls -l /app/mysql/
total 36
drwxr-xr-x 2 root root 4096 Mar 4 14:55 bin
-rw-r--r-- 1 7161 31415 17987 Sep 13 2017 COPYING
drwxr-xr-x 2 root root 55 Mar 4 14:55 docs
drwxr-xr-x 3 root root 4096 Mar 4 14:55 include
drwxr-xr-x 5 root root 229 Mar 4 14:55 lib
drwxr-xr-x 4 root root 30 Mar 4 14:55 man
-rw-r--r-- 1 7161 31415 2478 Sep 13 2017 README
drwxr-xr-x 28 root root 4096 Mar 4 14:55 share
drwxr-xr-x 2 root root 90 Mar 4 14:55 support-files
修改环境变量:
vim /etc/profile
export PATH=/app/mysql/bin:$PATH
[root@db01 bin]# source /etc/profile
useradd mysql
5.4. 创建相关目录并修改权限
mkdir /data/mysql -p
chown -R mysql.mysql /app/*
chown -R mysql.mysql /data/*
方法一:
初始化数据,初始化管理员的临时密码
mysqld --initialize --user=mysql --basedir=/app/mysql --datadir=/data/mysql
2019-04-18T03:21:53.381108Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-04-18T03:21:54.583415Z 0 [Warning] InnoDB: New log files created, LSN=45790
2019-04-18T03:21:54.697859Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-04-18T03:21:54.760821Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 1daa0c57-6189-11e9-bc80-000c294234c8.
2019-04-18T03:21:54.770856Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2019-04-18T03:21:54.772016Z 1 [Note] A temporary password is generated for root@localhost: 9LN.fh_Ea#uU
报错原因: Linux系统中缺少libaio-devel 软件包
解决:
yum install -y libaio-devel
报错原因:
在/data/mysql 存在文件
解决:
\rm -rf /data/mysql/*
新特性重要说明:
5.7开始,MySQL加入了全新的 密码的安全机制:
1.初始化完成后,会生成临时密码(显示到屏幕上,并且会往日志中记一份)
2.密码复杂度:长度:超过12位? 复杂度:字符混乱组合
3.密码过期时间180天
(2)