报错如下
`import mysql.connector as mysql
connection = mysql.connect(host="10.251.xx.xx", port=xxxx, db="test", user="u_test", passwd="xxxxx")
Traceback (most recent call last):
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 176, in _open_connection
self._cmysql.connect(**cnx_kwargs)
_mysql_connector.MySQLInterfaceError: Access denied for user 'u_test', because password is error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/init.py", line 172, in connect
return CMySQLConnection(*args, kwargs)
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 78, in init
self.connect(kwargs)
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/abstracts.py", line 731, in connect
self._open_connection()
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 179, in _open_connection
sqlstate=exc.sqlstate)
mysql.connector.errors.DatabaseError: 1045 (HY000): Access denied for user 'u_test', because password is error `
python版本3.6.5 mysql-connector-python 8.0.12 mycat版本1.6.5 比较奇怪的是,在windows环境下可以连,但是同样版本的python和mysql-connector-python在centos7.X上面都不行
报错如下 `import mysql.connector as mysql connection = mysql.connect(host="10.251.xx.xx", port=xxxx, db="test", user="u_test", passwd="xxxxx") Traceback (most recent call last): File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 176, in _open_connection self._cmysql.connect(**cnx_kwargs) _mysql_connector.MySQLInterfaceError: Access denied for user 'u_test', because password is error
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/init.py", line 172, in connect
return CMySQLConnection(*args, kwargs)
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 78, in init
self.connect(kwargs)
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/abstracts.py", line 731, in connect
self._open_connection()
File "/usr/local/virtualenv/py_ptolemy/lib/python3.6/site-packages/mysql/connector/connection_cext.py", line 179, in _open_connection
sqlstate=exc.sqlstate)
mysql.connector.errors.DatabaseError: 1045 (HY000): Access denied for user 'u_test', because password is error `