下载源
wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
安装源
rpm -Uvh mysql57-community-release-el7-10.noarch.rpm
安装MySQL服务端
yum install -y mysql-community-server
启动mysql
systemctl start mysqld.service
检查状态
systemctl status mysqld.service
获取临时密码
grep 'temporary password' /var/log/mysqld.log
登陆
mysql -uroot -p
修改mysql密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
授权远程登陆
grant all privileges on . to root@'%'identified by 'password';
FLUSH PRIVILEGES;
修改数据库配置文件:
vim /etc/my.cnf
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
lower_case_table_names=1
max_allowed_packet=32M
max_connections=3000
重启
systemctl restart mysqld
网友评论