When I use slqalchemy to connect to the mysql database, I get an error and it shows that I can't load uft8mb4. I have the answer that I want to modify the file '/user/share/mysql/charsets'. I found that I don't have this folder. I guess because When someone else installed mysql, the default location of mysql was changed.
I have modified '/etc/mysql/mysql.cnf' The default encoding in the file. Then restart the service, but still can't
File "/usr/python/lib/python2.7/site-packages/django/db/backends/__init__.py", line 115, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/python/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 435, in get_new_connection
conn = Database.connect(**conn_params)
File "/usr/python/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/usr/python/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/connections.py", line 221, in __init__
self.set_character_set(charset)
File "/usr/python/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg/MySQLdb/connections.py", line 312, in set_character_set
super(Connection, self).set_character_set(charset)
OperationalError: (2019, "Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)")