mysql中rpm方式安装的详解
查看安装以及卸载
# 查看 rpm -qa | grep mysql # 卸载 yum -y remove mysql-libs-5.1.66-2.el6_3.x86_64
1.centos7需要先卸载mariadb
查看命令rpm -qa | grep mariadb
安装包资源地址
mysql下载地址:https://dev.mysql.com/downloads/mysql/
# 下载资源名称 mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
解压资源
tar -xvf mysql-5.7.22-1.el7.x86_64.rpm-bundle.tar
获取rpm包
mysql-community-common-5.7.19-1.el6.x86_64.rpm mysql-community-client-5.7.19-1.el6.x86_64.rpm mysql-community-server-5.7.19-1.el6.x86_64.rpm mysql-community-libs-5.7.19-1.el6.x86_64.rpm
安装
# 安装顺序 # common --> libs --> clients --> server # 安装命令 rpm -ivh mysql-community-common-5.7.19-1.el6.x86_64.rpm mysql-community-libs-5.7.19-1.el6.x86_64.rpm mysql-community-client-5.7.19-1.el6.x86_64.rpm mysql-community-server-5.7.19-1.el6.x86_64.rpm
可能需要依赖包libaio
安装命令yum -y install libaio
初始化
mysqld --initialize --user=mysql
启动
service mysqld start
登录
# 查看初始密码 cat /var/logs/mysql.log #或者 grep 'password' /var/logs/mysql.log -n -B 5 # 登陆 mysql -uroot -p'123456' # 修改初始密码 set PASSWORD=PASSWORD('密码');
授权远程链接
### 授权192.168.0.1可以远程链接*[所有数据库].*[所有表] 账号:root 密码123456 grant all privileges on *.* to 'root'@'192.168.0.1' identified by '123456'; ### 授权所有ip grant all privileges on *.* to 'root'@'%' identified by '123456'; ### 以上*.*表示[数据库].[表] ### 使授权立刻生效 flush privileges;
相关推荐
emmm00 2020-11-17
王艺强 2020-11-17
aydh 2020-11-12
世樹 2020-11-11
zry 2020-11-11
URML 2020-11-11
spurity 2020-11-10
yifangs 2020-10-13
Andrea0 2020-09-18
Ida 2020-09-16
ltd00 2020-09-12
tufeiax 2020-09-03
xjd0 2020-09-10
greatboylc 2020-09-10
adsadadaddadasda 2020-09-08
疯狂老司机 2020-09-08
CoderToy 2020-11-16
ribavnu 2020-11-16
bianruifeng 2020-11-16