Forums

How to convert sqlite3 to mysql

I've tried many things and none of them seems to work. I don't know what else I can do because I get stuck at every avenue.

I used this tool (https://pypi.org/project/sqlite3-to-mysql/) but I get the error message « ERROR 2003: Can't connect to MySQL server on 'localhost:3306' (10061 Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée) »

I tried using sqlite "dump" command but it just shows an infinite number of "...>" rows.

I tried installing the sqlite addon for vscode and using the .dump command but it tells me --preserve-rowids? ?--newlines? ?LIKE-PATTERN?

I have searched elsewhere in this forum but the solution offered were all for Django (I'm using Flask).

Have a look at this help page on how to set up the MySQL uri (it's not running on the localhost). Also -- did you create the MySQL db via the Databases page on PythonAnywhere?

Yes I have a MySQL created on PythonAnywhere. I also looked at the help page you linked but it doesn't help much. As said in original comment, I'm not using Django, so the help page doesn't help much.

I also tried with the mysqlclient module from the help page but it requires ssh tunnel which requires paid account, which I don't have yet because I still can't setup my db...

SQLite database is just a file, so you need a script that would read the data from that file and write it to MySQL. Row after row.

Yes this is what I'm trying to do and none of the 4 ways I tried have worked so far...

Are you able to connect to your MySQL at all?