techouse / mysql-to-sqlite3

Transfer data from MySQL to SQLite
https://techouse.github.io/mysql-to-sqlite3/
MIT License
217 stars 31 forks source link

KeyError: 'ssl_disabled' #70

Closed andreaskoelsch closed 7 months ago

andreaskoelsch commented 7 months ago

Describe the bug When trying to connect to a MySQL Server, the mysql-connector-python throws KeyError: 'ssl_disabled'

Expected behaviour Connection works

Workaround Commenting transporter.py:126 solves the issue. Not sure if this is the intended solution, so not creating a PR

techouse commented 7 months ago

Hi,

Have you tried disabling SSL using the -S switch?

Can you please provide all the info the template requested?

andreaskoelsch commented 7 months ago

Yes, I have. The problem is, that the key is no longer existing in mysql-connector-python, so setting it to False will cause a KeyError, too. Sorry for not filling the template. I'm using the latest version of mysql-to-sqlite3, here's the output of mysql2sqlite --version

| software               | version                              |
|------------------------|--------------------------------------|
| mysql-to-sqlite3       | 2.1.10                               |
|                        |                                      |
| Operating System       | Windows 10                           |
| Python                 | CPython 3.9.19                       |
| MySQL                  | MySQL client not found on the system |
| SQLite                 | 3.41.2                               |
|                        |                                      |
| click                  | 8.1.7                                |
| mysql-connector-python | 2.2.9                                |
| python-slugify         | 8.0.4                                |
| pytimeparse2           | 1.7.1                                |
| simplejson             | 3.19.2                               |
| tabulate               | 0.9.0                                |
| tqdm                   | 4.66.2                               |

Edit: not sure why it says mysql-connector-python version 2.2.9. Here's a pip freeze:

> pip freeze | Select-String -Pattern 'mysql'

mysql-connector==2.2.9
mysql-connector-python==8.3.0
mysql-to-sqlite3==2.1.10
andreaskoelsch commented 7 months ago

Ohh.. now I understand. mysql-connector-python is the successor of mysql-connector. I thought they were independent packages. After removing mysql-connector and reinstalling mysql-connector-python it's working again. Consider this closed. Thanks for the hint!

techouse commented 7 months ago

Interesting. I wonder how come you even got mysql-connector to install considering the fact that the package requires only https://github.com/techouse/mysql-to-sqlite3/blob/8d3f70a40e48117b39965b692ea3112be0309858/pyproject.toml#L42 Have you maybe not used an isolated environment, i.e. python -m venv env