明确写了用户''@'localhost'访问拒绝
控制台登上mysql
然后给''@'localhost'的权限
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> select host, user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| % | root |
| localhost | |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
5 rows in set (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON *.* TO ''@'%localhost' IDENTIFIED BY 'Dre@mtech_1012' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql>
https://blog.csdn.net/Skirt_Gentleman/article/details/81630448