赞
踩
先下载mysql的repo源
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum安装mysql源包
yum -y install mysql57-community-release-el7-10.noarch.rpm
安装MySQL
用yum module disable mysqL先禁用本地的 MySQL 模块
yum module disable mysql
安装mysql
yum -y install mysql-community-server
启动MySQL
systemctl start mysqld.service
查看MySQL初始密码
grep "password" /var/log/mysqld.log
登录数据库
mysql -uroot -p
修改MySQL默认密码
修改密码安全策略为低(只校验密码长度,至少8位)
set global validate_password_policy=0;
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '12345678';
授予root用户远程管理权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '12345678';
刷新数据库
FLUSH PRIVILEGES;
退出数据库
exit
查看已安装的mysql
rpm -qa | grep -i mysql
卸载mysql
卸载mysql
yum remove mysql-community-server-5.6.36-2.el7.x86_64
查看mysql的其它依赖:
rpm -qa | grep -i mysql
//卸载依赖
1. yum remove mysql-libs 2. yum remove mysql-server 3. yum remove perl-DBD-MySQL 4. yum remove mysql
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。