centos8.0 安装 mysql8.0

检查是否安装,如果安装则卸载

rpm -qa|grep mysql
rpm -e --nodeps

下载rpm包仓库

wget https://repo.mysql.com/mysql80-community-release-el8-1.noarch.rpm

rpm -ivh mysql80-community-release-el8-1.noarch.rpm

yum update

yum install mysql-community-server

mysql

user mysql;

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'tw369.com';

FLUSH PRIVILEGES;

mysql -uroot -p

设置Mysql远程访问账户密码

update user set host ="%" where user = "root";

flush privileges;

解决Mysql乱码问题

找一个配置文件,复制到/etc/目录,命名为my.cnf

cp /usr/share/doc/mysql-server-5.1.73/my-medium.cnf /etc/my.cnf

vi my.cnf

在[client]和[mysqld]下面都添加上

default-character-set=utf8

service mysqld restart

上一篇:Liunx安装MySql数据库步骤


下一篇:【552】获取 cplex academic 版本(community 转移)