wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase “用户名” “密码”);
dhclient wlp3s0;
systemctl start network.service;
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
yum localinstall mysql57-community-release-el7-8.noarch.rpm
yum repolist enabled | grep "mysql.*-community.*"
yum install mysql-community-server
systemctl start mysqld
grep 'temporary password' /var/log/mysqld.log
2020-04-01T06:04:30.472082Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: TuOoxF;Ug6_q
vi /etc/my.cnf 在最后一行加skip-grant-tables保存重启mysql
systemctl restart mysqld
登陆mysql一路回车无需密码
mysql -uroot -p
登录后
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> update user set authentication_string="" where user="root";
Query OK, 1 row affected (0.12 sec)
Rows matched: 1 Changed: 1 Warnings: 0
删除刚才加入的skip-grant-tables在/etc/my.cnf 文件中,然后重启mysql,一路回车登陆。
[root@bogon /home/wanbao]$ vi /etc/my.cnf
[root@bogon /home/wanbao]$ systemctl restart mysqld
[root@bogon /home/wanbao]$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.19
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
修改密码,并刷新缓存,下次登陆就需要输入密码登录
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '自己的密码' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.43 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.34 sec)
mysql> update user set host='%';
Query OK, 3 rows affected (0.37 sec)
Rows matched: 4 Changed: 3 Warnings: 0
mysql> select User,authentication_string,Host from user;
+------------------+------------------------------------------------------------------------+------+
| User | authentication_string | Host |
+------------------+------------------------------------------------------------------------+------+
| mysql.infoschema | $A$005$ERFFFFSSCC| % |
| mysql.session | $A$005$ $A$005$ERFFFFSSCC| % |
| mysql.sys | $A$005$ $A$005$ERFFFFSSCC| % |
| root | $A$005$* -A$005$ERFFFFSSCC| % |
+------------------+------------------------------------------------------------------------+------+
4 rows in set (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.62 sec)
退出mysql发现还是登录不了,查看3306端口,外部并不能访问
netstat -an|grep 3306
打开对外访问权限,这个简单的问题搞了一晚上终于找到解决方案
firewall-cmd --add-port=3306/tcp