Skip to content
Sign upLog in
← Back to Community

Is there a way to connect python to MySql?

Profile icon
WarMachine522

I want to find out a way of connecting python to MySql in order to store things like account data. I honestly do not know where and how to start, so no code has been attached. Plus, I don't find results that can apply to REPL when I search the web, or at least I don't think I do, as I do not know REPL's full functionality and its inner workings.

Thx,
WarMachine522

Voters
Profile icon
Rosamaria01
Profile icon
WarMachine522
Comments
hotnewtop
Profile icon
[deleted]

I hate to be lazy when writing comments but.....https://www.w3schools.com/python/python_mysql_getstarted.asp

It's a great tutorial for learning Python with MySQL. They can explain it better than I can. MySQL should work fine with repl.it, any further issues - Let me know :)

Profile icon
WarMachine522

@JacksonCowie
Hi. So, I encountered a couple of problems when trying to implement mysql. For example, I do not know which database to install from the mysql downloads website. Also, when I try to follow the instructions and import mysql.connecter, it says that there is no such module. Where do I go from here?

Profile icon
WarMachine522

@WarMachine522
Actually, I solved it. Instead of using a local MySQL database, I used the remote MySQL website. It's called remotemysql.com. Anyways, THX FOR THE CLARIFICATION!

Profile icon
[deleted]
Profile icon
AlexCattelona

@RogueHalo
I know I am a bit late here, I have an SQL Database and everything but when attempting to import the SQL Connector module it says there is no such module, Like
@WarMachine522
Mentioned, Have you got a fix or anything to this issue? Thanks in advance!

Profile icon
WarMachine522

@AlexCattelona
After doing some research, I figured out that u have to import mysql.connector... the how-to's to use it are in multiple tutorials on the web

Profile icon
AlexCattelona

@WarMachine522
Yeah it wont let me import MySQL.Connector for some reason, Do you know of any links?

Profile icon
WarMachine522

@AlexCattelona
oh wait, I think ik what's happening. U have to download the mysql.connector package... On the right of the project window, there should be a tab where you can install packages... Search up mysql.connector in there and click the plus sign to be able to import it in ur program

Profile icon
AlexCattelona

@WarMachine522
It wasnt working at first but I managed to solve the problem, Just had to make a new Repl and try a different version, Many thanks for your help!!

Profile icon
WarMachine522

@AlexCattelona
No problem! Always willing to help someone striding into the depths of MySQL!