检查是否安装,如果安装则卸载
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