第一次作业
1、CentOS7 RPM方式安装MySQL5.7
2、CentOS7 通用二进制方式安装MySQL5.7
3、简述MySQL体系结构。
4、使用mysql客户端登录服务器,重置root密码
1、RPM安装MySQL
下载rpm安装包,解压
tar xf mysql-5.7.32-1.el7.x86_64.rpm-bundle.tar
yum remove mariadb-libs
rpm -ivh mysql-community-client-5.7.32-1.el7.x86_64.rpm mysql-community-common-5.7.32-1.el7.x86_64.rpm mysql-community-libs-5.7.32-1.el7.x86_64.rpm mysql-community-server-5.7.32-1.el7.x86_64.rpm
[root@localhost ~]# systemctl start mysqld
[root@localhost ~]# systemctl enable mysqld
2、通用二进制方式安装MySQL5.7
新建用户以安全方式运行进程
tar xf mysql-5.7.32-linux-glibc2.12-x86_64.tar.gz -C /usr/local
ln -sv mysql-5.7.32-linux-glibc2.12-x86_64/ /usr/local/mysql
mkdir -p /data/mysql
/usr/local/mysql-5.7.32-linux-glibc2.12-x86_64/bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql
cp /usr/local/mysql-5.7.32-linux-glibc2.12-x86_64/support-files/mysql.server /etc/init.d/
chkconfig --add mysql.server
chkconfig mysql.server on
vim /etc/my.cnf
systemctl start mysql.server
配置环境变量
source /etc/profile.d/mysql.sh
mysql -uroot -p
alter user root@localhost identified by 'Mysql@123'
Mysql是由SQL接口,解析器,优化器,缓存,存储引擎组成的