当前位置:Gxlcms > 数据库问题 > centos8.0 安装 mysql8.0

centos8.0 安装 mysql8.0

时间:2021-07-01 10:21:17 帮助过:30人阅读

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

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-server

systemctl start mysqld
systemctl enable mysqld
systemctl status mysqld
systemctl enable mysqld.service

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

centos8.0 安装 mysql8.0

标签:sys   href   wget   mysq   cte   rpm   密码   一个   ref   

人气教程排行