Error:Connection to django1@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
A few days ago a whim, in order to look good pycharm interface style, on the other hand due to upgraded 2019 version of pycharm, then. . . Then there such a situation
How Rom, obviously a few days ago also, so it, I think the new version will not be a problem, so he began Baidu up. . .
So they turned a one way, and the same table two painstaking attempts to update, modify URL. . . And so on, sent did not uninstall and then reinstall the MySql
Encounter the most problems say is: time zone problem, but I can not read ah ~ anyway, try to follow, download new drivers, etc., etc., then this method will show the connection is successful
Finally, no redness, and the connection is successful ~
Looked successful, but overall I feel like something is wrong, I do not have to modify the URL each time you connect it, sure enough, after the connection, that's it. . .
what? What Well, my watch it ~ ah ~ what a mess! I said he was very anxious and helpless <!> Ha ha ha
Finally really try too much, so I found this method, then, we get to the point, the perfect solution!
1 . Check the user and password for errors
2. Check the connection pool is correct, the new version of the 8.0 mysql connection pool should be
3 . Try to change the time zone (often problems are found in this) a. in a terminal to log in using administrator mysql, which is root mysql -uroot -p123 b. enter the command show variables like '%time_zone%'
. c Mysql default time for the United States, to our time zone at 8:00 hours, so time can modify
the SET , Ltd. Free Join time_zone = ' +8: 00 ' ;
d. After the settings finished, quit mysql, log in again to check whether the time is modified
4. After the end you can exit cmd, to reconnect a look inside pycharm
So, it is best not to upgrade to the new version, because maybe someday it will pop out a new bug to let you off guard
, however, life is not fun to go out and do their own thing, to try, you can have a problem to solve ah, their preferences most important, in order to select good-looking interface to their own satisfaction, step by step to find and solve the problem I was very satisfied, there is no problem and not to choose their favorite, sorry, I seem unable to do , ha ha ha, I am me, a spirit over the top, and the pursuit of perfection of my obsessive-compulsive disorder.
PS: thanks to the great God who on Baidu, give you praise, part of the solution to the great God who picked from
end