I started seeing this error a month or two ago, when running mycli on the server:
% mycli -u myuser
Connecting to socket /var/run/mysqld/mysqld.sock, owned by user mysql
[Errno 13] Permission denied
Similar response with mycli -u root (as user root).
The .mycli.log showed:
2022-10-23 12:32:15,299 (279176/MainThread) mycli.config WARNING - Unable to parse line None of config file '/etc/mysql/my.cnf'.
2022-10-23 12:32:15,299 (279176/MainThread) mycli.config WARNING - Using successfully parsed config values.
2022-10-23 12:32:15,300 (279176/MainThread) mycli.config WARNING - Unable to parse line None of config file '/etc/mysql/conf.d/mysqldump.cnf'.
2022-10-23 12:32:15,300 (279176/MainThread) mycli.config WARNING - Using successfully parsed config values.
2022-10-23 12:32:15,302 (279176/MainThread) mycli.config WARNING - Unable to parse line None of config file '/etc/mysql/my.cnf'.
2022-10-23 12:32:15,302 (279176/MainThread) mycli.config WARNING - Using successfully parsed config values.
2022-10-23 12:32:15,303 (279176/MainThread) mycli.config WARNING - Unable to parse line None of config file '/etc/mysql/conf.d/mysqldump.cnf'.
2022-10-23 12:32:15,303 (279176/MainThread) mycli.config WARNING - Using successfully parsed config values.
2022-10-23 12:32:15,309 (279176/MainThread) mycli.main
ERROR - traceback: 'Traceback (most recent call last):\n File
"/usr/lib/python3/dist-packages/mycli/main.py", line 482, in connect\n
_connect()\n File "/usr/lib/python3/dist-packages/mycli/main.py",
line 456, in _connect\n self.sqlexecute = SQLExecute(\n
File "/usr/lib/python3/dist-packages/mycli/sqlexecute.py",
line 119, in __init__\n self.connect()\n File
"/usr/lib/python3/dist-packages/mycli/sqlexecute.py",
line 179, in connect\n conn = pymysql.connect(\n File
"/usr/lib/python3/dist-packages/pymysql/connections.py", line 285,
in __init__\n self.ctx = self._create_ssl_ctx(ssl)\n File
"/usr/lib/python3/dist-packages/pymysql/connections.py", line
387, in _create_ssl_ctx\n ctx.load_cert_chain(sslp["cert"],
keyfile=sslp.get("key"))\nPermissionError: [Errno 13] Permission denied\n'
indicating some SSL cert problem. Since I didn't care about SSL in this case and just wanted to connect via mysqld.sock, I opened sqlexecute.py in /usr/lib/python3/dist-packages/mycli and edited this line
I started seeing this error a month or two ago, when running mycli on the server:
Similar response with
mycli -u root
(as user root).The .mycli.log showed:
indicating some SSL cert problem. Since I didn't care about SSL in this case and just wanted to connect via mysqld.sock, I opened sqlexecute.py in /usr/lib/python3/dist-packages/mycli and edited this line
changing
ssl=ssl
tossl=''
. This fixed the problem, but obviously not a permanent fix.Is this a bug, or is my system misconfigured? No trouble with anything else on the system, including SSL.
Server: Ubuntu 22.04, mysqld Ver 8.0.30-0ubuntu0.22.04.1 for Linux