mysql部署
1.载安装包
2.安装部署
3. 配置文件 管控mysql
4.卸载
1.下载安装包
5.7
安装包种类:
rpm包 :mysql source code =》 rpm包
mysql-5.7.38-1.el7.x86_64.rpm-bundle.tar
tar包:mysql source code +开发加的mysql代码 =》 编译打包生成 tar包
mysql-5.7.38-el7-x86_64.tar.gz
2.安装部署
1.上传mysql 安装包
[root@bigdata31 software]# ll
total 595272
-rw-r–r–. 1 root root 609556480 Aug 26 2021 mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
[root@bigdata31 software]# pwd
/root/software
2.部署
1.解压
[root@bigdata31 software]# tar -xvf ./mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
mysql-community-embedded-5.7.28-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
mysql-community-devel-5.7.28-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.28-1.el7.x86_64.rpm
mysql-community-libs-5.7.28-1.el7.x86_64.rpm
mysql-community-test-5.7.28-1.el7.x86_64.rpm
mysql-community-common-5.7.28-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.28-1.el7.x86_64.rpm
mysql-community-client-5.7.28-1.el7.x86_64.rpm
mysql-community-server-5.7.28-1.el7.x86_64.rpm
3.安装
1.卸载 mariadb 相关的东西
[root@bigdata31 software]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[root@bigdata31 software]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
[root@bigdata31 software]# rpm -qa | grep mariadb
rpm -ivh mysql-community-common-5.7.28-1.el7.x86_64.rpm
注意:
package mariadb-libs conflicts with
rpm -ivh mysql-community-libs-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.28-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.28-1.el7.x86_64.rpm
4.有一个 配置文件 管控mysql
/etc/my.cnf
mysql运行日志文件:log-error=/var/log/mysqld.log
5.初始化mysql
mysqld --initialize --user=mysql
A temporary password is generated for root@localhost: rfnYYHj0jc,R
6.启动mysql
systemctl start mysqld
mysql 可以对外提供服务:
port: 3306
7.登录mysql 使用
mysql -uroot -prfnYYHj0jc,R
8.修改mysql 软件 root用户 密码
set password = password(‘123456’);
9.赋予权限
flush privileges;
4.卸载:
1.mysql 停掉
systemctl stop mysqld
2.mysql卸载
rpm -qa | grep mysql
rpm -qa | grep mysql | xargs -n1 rpm -e --nodeps
3.linux存储目录删掉
find / -name “mysql”
注意:/sys/
4.重装
mysql 全部卸载重装