(1)数据库系统
RDS:关系型,oracle,mysql,mariaDB,percona server ,DB2
NoSQL:Redis,MongoDB,memcache
(2)SQL语言:结构化查询语言
DDL语句 数据定义语言:数据库丶表丶视图丶索引丶存储过程丶函数丶create drop alter
DML语句 数据库操作语言:插入数据insert,删除数据delete丶更新数据update丶
DQL语句 数据库查询语句:查询数据selete
DCL语句 数据库控制语言:grant,revoke
(3)数据库访问技术
ODBC:php
JDBC:JAVA
(4)mysql安装方式
二进制rpm:yum repository mysql57-community-release-el7-9.noarch.rpm
二进制预编译: Generic mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz
源码编译安装: source code mysql-5.7.16.tar.gz
(5)yum安装mysql5.7
systemctl stop firewalld
systemctl disable firewalld
- 安装mysql官方yum源和安装mysql-server
rpm -ivh https://repo.mysql.com//mysql57-community-release-el7-11.noarch.rpm
yum makecache
yum repolist
yum install mysql-community-server -y
systemctl enable mysqld
systemctl start mysqld #mysql启动会进行数据库的初始化
yum安装的数据目录在/var/lib/mysql
ll /var/lib/mysql
- mysql 5.7之后默认root密码不为空,yum安装方式的随机密码生成在/var/log/mysqld.log,根据这个随机密码重置root密码
grep "password" /var/log/mysqld.log
2018-04-17T14:57:38.763497Z 1 [Note] A temporary password is generated for root@localhost: 1l79szme<=EJ
修改默认密码:mysqladmin -uroot -p'1l79szme<=EJ' password "Mysql@123"
(6)二进制方式安装mysql5.7.21
mkdir /tools &>/dev/null ; cd /tools
wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
tar xvf mysql-5.7.21-linux-glibc2.12-x86_64.tar.gz -C /usr/local
ln -sv /usr/local/mysql-5.7.21-linux-glibc2.12-x86_64 /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
mkdir -pv /data/mydata
chown -R mysql:mysql /data/mydata
cd /usr/local/mysql
bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mydata
#会生成一个临时root密码:A temporary password is generated for root@localhost: pet3luts*F#R
cp -rf /etc/my.cnf{,.old}
>/etc/my.cnf
[mysqld]
basedir=/usr/local/mysql
datadir=/data/mydata
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
chkconfig --add /etc/init.d/mysqld
chkconfig mysqld on
echo "export PATH=/usr/local/mysql/bin:$PATH" >>/etc/profile
source /etc/profile
systemctl start mysqld
ss -anltup | grep 3306
ps -ef | grep mysqld
mysql -uroot -p'pet3luts*F#R'
mysql> alter user root@'localhost' identified by 'MysqlMysql@123';
mysql> flush privileges;
或者使用这种方式修改:mysqladmin -uroot -p'MysqlMysql@123' password "Mysql@123"