centos--mysql
安装wget
下载对应mysql rpm
wget http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
取得mysql
rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
安装mysql
yum install -y mysql-community-server
启动mysql
service mysqld start
开机启动
systemctl enable mysqld
systemctl daemon-reload
下载对应mysql rpm
wget http://repo.mysql.com/mysql57-community-release-el7-11.noarch.rpm
取得mysql
rpm -Uvh mysql57-community-release-el7-11.noarch.rpm
安装mysql
yum install -y mysql-community-server
启动mysql
service mysqld start
开机启动
systemctl enable mysqld
systemctl daemon-reload
取得初始密码
grep 'temporary password' /var/log/mysqld.log
使用初始密码登录
mysql -uroot -p
修改参数
mysql> set global validate_password.policy=0; 或者set global validate_password_policy=0;
mysql> set global validate_password.length=1;
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root1234';
grep 'temporary password' /var/log/mysqld.log
使用初始密码登录
mysql -uroot -p
修改参数
mysql> set global validate_password.policy=0; 或者set global validate_password_policy=0;
mysql> set global validate_password.length=1;
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root1234';
添加
firewall-cmd --zone=public --add-port=3306/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
重启防火墙
systemctl start firewalld
firewall-cmd --zone=public --add-port=3306/tcp --permanent (--permanent永久生效,没有此参数重启后失效)
重新载入
firewall-cmd --reload
重启防火墙
systemctl start firewalld
完成
systemctl start mysqld
设置时区
service mysqld stop
vi /etc/my.cnf
default-time-zone = '+08:00'
service mysqld start
mysql>mysql -uroot -proot123456
mysql>show variables like 'max_connections';(查可以看当前的最大连接数)
msyql>set global max_connections=1000;(设置最大连接数为1000,可以再次查看是否设置成功)
mysql -h 127.0.0.1 -u root -plss789 -P33066