- 新安装的 centos7 系统需要 配置IP
- 修改配置
执行命令 - 重启网络服务 - 获取IP
systemctl restart network
ip addr //获取IP地址
- 远程工具 CRT 或者 xshell 连接(随个人喜好=。=)
//安装 wget
yum -y install wget
yum -y install vim
- 安装mysql
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql-server
- 启动mysql服务
service mysqld restart
- 重置密码
grep "password" /var/log/mysqld.log
mysql -u root -p 回车
密码:xxx
#更改密码策略为LOW
set global validate_password_policy=0;
#更改密码长度
set global validate_password_length=0;
alter user 'root'@'localhost' identified by '123456';
CREATE USER 'ab'@'%' IDENTIFIED BY '123456';
grant all on *.* to 'ab'@'%' identified by '123456' with grant option;
update mysql.user set host='%' where user='root';
flush privileges;
exit;
service mysqld restart
- 关闭防火墙
firewall-cmd --state //查看防火墙状态
systemctl stop firewalld.service //停止firewall
systemctl disable firewalld.service //禁止firewall开机启动
Over.~~ =。=
补充一下:
配置文件:/etc/my.cnf
日志文件:/var/log/var/log/mysqld.log
服务启动脚本:/usr/lib/systemd/system/mysqld.service
socket文件:/var/run/mysqld/mysqld.pid