centos7安装mysql

 1 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
 2 yum -y install mysql57-community-release-el7-10.noarch.rpm 
 3 rpm -qa | grep -i mariadb
 4 yum module disable mysql
 5 yum install   mysql-server
 6 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
 7 yum install   mysql-server
 8 systemctl start  mysqld.service
 9 systemctl status mysqld.service
10 grep "password" /var/log/mysqld.log
11 mysql -uroot -papPu2d#wlsij
12    ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
13    grant all privileges on *.* to 'myself'@'%' identified by 'password' with grant option;
14    flush privileges;
15 
16 mysql配置:
17 [client]
18 default-character-set=utf8
19 
20 [mysqld]
21 character-set-server=utf8
22 collation-server=utf8_general_ci

 

posted @ 2022-08-11 11:58  Pynix  阅读(19)  评论(0编辑  收藏  举报