Linux CentOS7 rpm 安装 MySQL 5.7一、参考资料【MySQL数据库入门到大牛mysql安装到优化百科全书级全网天花板】 https://www.bilibili.com/video/BV1iq4y1u7vj/?p99share_sourcecopy_webvd_source855891859b2dc554eace9de3f28b4528VMvare 安装 CentOS 7二、笔记总结2.1、上传 rpm 安装包2.2、卸载系统自带的 mariadb#查看是否安装了rpm-qa|grep-imariadb#如果有卸载掉。rpm-ivhmysql-community-common-5.7.28-1.el7.x86_64.rpm2.3、检查权限和依赖chmod-R777/tmprpm-qa|greplibaiorpm-qa|grepnet-tools2.4、按顺序安装rpm-ivhmysql-community-common-5.7.28-1.el7.x86_64.rpmrpm-ivhmysql-community-libs-5.7.28-1.el7.x86_64.rpmrpm-ivhmysql-community-client-5.7.28-1.el7.x86_64.rpmrpm-ivhmysql-community-server-5.7.28-1.el7.x86_64.rpm2.5、检查安装结果rpm-qa|grep-imysqlcat/var/log/mysqld.log#默认密码tbtwty0tXP*i2.6、启动 MySQL#启动systemctl start mysqld#查看状态systemctl status mysqld#检查是否开机自启动systemctl list-unit-files|grepmysqld.service2.7、登录 MySQLmysql-uroot-palter userrootlocalhostidentified byabc123;2.8、设置远程连接权限usemysqlselecthost,userfromuser;updateusersethost%whereuserroot;flushprivileges;2.9、修改字符集编码vim/etc/my.cnfcharacter_set_serverutf8#重启 MySQL 生效systemctl restart mysqld.servicemysql-uroot-pshowvariableslike%character%;