MySQL安装(5.7 yum安装)

2022-05-25 20:16
251
0
添加收藏
1、Mysql yum repository
https://repo.mysql.com/ 2、安装文档详见
 
3、下载
wget http://repo.mysql.com/mysql57-community-release-el7.rpm
4、安装
#安装源 rpm -ivh mysql57-community-release-el7.rpm 
 
#密钥过期问题 rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 
 
#安装mysql yum install mysql-server
 
 #获取默认安装密码 service mysqld start (启动mysql) grep "password" /var/log/mysqld.log (获取密码)
 
 #登录并修改root密码 - 注意密码需要具备一定的强度 mysql -u root - p 'passowrd' (登录) SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password') (修改密码)
5、修改默认字符集
#在my.cnf 或 my.ini内的[mysqld] 下追加以下内容 character_set_server=utf8 
 
6、查询验证

#确定字符集为utf-8 show variables like "%character%"; show variables like "%collation%";

全部评论