Detailed steps for connecting to the mysql database in pycharm, pycharmmysql
Preface
Recently, When I configured a pycharm project in a new environment, I found that pycharm cannot connect to the mysql database. Because the java environment has been installed but related libraries have not been configured, and jetbrains IDE is generally written in java, it is assumed that java lacks the mysql driver. So it was a success, so I shared the process with everyone and needed friends to study and learn together.
1. Ensure that python can connect to the database normally
It can be tested. If no error is reported, the database is connected normally.
If an error is reported, the MySQLdb package may be missing.
Download MYSQLdb first
Official download: MySQLdb
Local download: 32: http://www.bkjia.com/database/552380.html 64: http://www.bkjia.com/database/552384.html
Install the SDK step by step.
2. Configure the java environment
This step provides a lot of online tutorials and is also very simple.
3. Configure pycharm
Download mysql jdbc mysql-connector-java
Note the location of the file after decompression
Open the database plug-in of pycharm and add a MySQL connection.
Complete the items
Note that the Driver you see may be different from me at this time, which means you need to proceed
After adding, check again and solve the problem.
Summary
The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.