赞
踩
# 查看是否存在
rpm -qa | grep mariadb
# 如果存在则执行命令进行卸载
rpm -e --nodeps mariadb-libs
cd /opt
mkdir MySQL
rpm -ivh 01_mysql-community-common-5.7.29-1.el7.x86_64.rpm
rpm -ivh 02_mysql-community-libs-5.7.29-1.el7.x86_64.rpm
rpm -ivh 03_mysql-community-libs-compat-5.7.29-1.el7.x86_64.rpm
rpm -ivh 04_mysql-community-client-5.7.29-1.el7.x86_64.rpm
rpm -ivh 05_mysql-community-server-5.7.29-1.el7.x86_64.rpm
注意:这里安装mysql-server时有可能出现以下异常
a) 错误:依赖检测失败:
libaio.so.1()(64bit) 被 mysql-community-server-5.7.29-1.el7.x86_64 需要
# 通过yum安装缺少的依赖:
yum install -y libaio
# 查看MySQL的临时密码:
cat /var/log/mysqld.log
# 启动MySQL服务:
systemctl start mysqld
# 连接MySQL:
mysql -uroot -p'初始密码'
**这里大家可以自行安排 **
set password=password(‘你的密码’);
利用root账号本地登录,修改mysql数据库,user表的root用户的远程访问权限
# 在mysql当中执行
update mysql.user set host='%' where user='root';
flush privileges;
vi /etc/my.cnf
# 在[mysqld]下面添加character-set-server=utf8
[mysqld]
character-set-server=utf8
# 重启MySQL
systemctl restart mysqld
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。