Tag Archives: Software exception

[Solved] ERROR com.alibaba.druid.pool.DruidDataSource – init datasource error, url jdbcmysql

Error reporting when deploying an open source project

ERROR com.alibaba.druid.pool.DruidDataSource - init datasource error, url jdbcmysql://

Obviously, there is a database connection error

But after eliminating the error, I can find the real cause of the error

Database connection address error

Network problems

Wrong user name and password

Finally, it was found that there was a problem with the MySQL driver version of the open source project, which was inconsistent with the MySQL I installed

Solution:

Go to POM.XML and delete the version information of MySQL, which can be used by default, as shown below

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
</dependency>

[Solved] Error “incorrect padding” in decoding of Base64 module in Python

Problem description
decodes the field information encoded by Base64, which is normally decoded in the base64 encoding and decoding tool, but b64decode and A2B in the modules Base64 and binascii under python_ Decoding error in Base64 and other methods
the error information is as follows

---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-11-787bc11958b4> in get_proxies(urls)
     14         try:
---> 15             raw = base64.b64decode(response)
     16         except Exception as r:

c:\program files\python3\lib\base64.py in b64decode(s, altchars, validate)
     86         raise binascii.Error('Non-base64 digit found')
---> 87     return binascii.a2b_base64(s)
     88 

Error: Incorrect padding

Solution

Base64 in Python is read in 4, so the field to be decoded should be a multiple of 4, not enough to add ‘=’

# The field a to be decoded is judged, and if it is a multiple of 4, it is unchanged, and if not, how much is missing, how much is made up
a = a + '=' * (4 - len(a) % 4) if len(a) % 4 != 0 else a