时间:2021-07-01 10:21:17 帮助过:21人阅读
(3)
[root@localhost mysql]# cd bin/
[root@localhost bin]# ./mysqld_safe --user=mysql &
9:启动mysql
[root@localhost bin]# service mysql start或者 [root@localhost bin]# systemctl start mysqld.service
[root@localhost bin]# /etc/init.d/mysqld restart
10:设置开机自启动
[root@localhost bin]# chkconfig --level 35 mysqld on
11:登录mysql
[root@localhost bin]# ./mysql -u root -p
Enter password:
(此处密码看第12步)
12:查看系统自动生成的密码
[root@localhost bin]# cat /root/.mysql_secret
# Password set for user ‘root@localhost‘ at 2017-08-13 16:54:06
0#n)?iduvHOt
13:修改mysql密码
mysql> set password=password(‘root’)
14:远程登录权限
mysql> grant all privileges on *.* to‘root‘ @‘%‘ identified by ‘root‘;
mysql> flush privileges;
mysql> quit
15:开启3306端口
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-port=3306/tcp
[root@localhost ~]# firewall-cmd --reload
[root@localhost ~]# firewall-cmd --query-port=3306/tcp
16:修改mysql无访问关闭mysql时间(默认8小时)[此步骤无需求可忽略]
查询
mysql> show global variables like ‘wait_timeout‘;
修改
mysql> set global wait_timeout=388000;
End 现在即可远程登录了
MySQL 5.7.19 CentOS 7 安装
标签:百度 .gz ls -l files span hot eve port 注意