服务器端操作
1.安装FTP
yum install -y vsftpd
2.准备ftp主目录
mkdir /var/ftp/mysql/
3.官网下载yum仓库的包。
下载地址:https://www.mysql.com/downloads/
centos系统下载MySQL Yum Repository
下载:wget https://repo.mysql.com//mysql80-community-release-el7-6.noarch.rpm
安装:yum install -y mysql80-community-release-el7-6.noarch.rpm
安装完成之后 /etc/yum.repos.d下会出现mysql的yum仓库文件
4.仅下载不安装mysql
yum install -y --downloadonly mysql-community-server
5.查找下载的mysql安装包,把mysql的包复制到/var/ftp/mysql下
查找:find /var/cache/yum/x86_64/7/ -iname "*.rpm"
复制:find /var/cache/yum/x86_64/7/ -iname "*.rpm" -exec cp -rf {} /var/ftp/mysql \;
6.创建依赖关系
cd /var/ftp/mysql/
yum install -y createrepo
createrepo /var/ftp/mysql/
7.FTP启动
systemctl start vsftpd
8.关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/selinux/config //永久关闭selinux
修改内容为:SELINUX=disabled
客户机端操作
1.自建YUM仓库
创建并编辑mysql的repo仓库文件:vim /etc/yum.repos.d/mysql.repo
[mysql-repo]
name=mysqlftp
baseurl=ftp://192.168.241.111/mysql
gpgcheck=0
enabled=1
2.下载安装
yum makecache
yum install -y mysql-community-server
3.启动mysql
systemctl start mysqld
systemctl status mysqld
grep password /var/log/mysqld.log 得出默认密码
3.更改密码
mysqladmin -uroot -p'#MVhrpe5IC_D' password 'LlLa@163.com'
默认密码/老密码 新密码
4.登录数据库
mysql -uroot -p'LlLa@163.com'