Forums

Table doesn't exist

Here is the mysql connection string I'm using after I made the table

connection = mysql.connector.connect(user='username', password='XXXXXXXX', host='amweiss.mysql.pythonanywhere-services.com', database='username$Main')

but I keep getting this error. any ideas what's going on here?

mysql.connector.errors.ProgrammingError: 1146 (42S02): Table 'username$Main.Main' doesn't exist

If you are actually using "username" in your connection string, you need to use your username, not the string "username". If you are using your username, then you just do not have a table called Main in your database. Make sure you use the name of a table that actually exists in your database.

Right...I just found the problem was the capitalization of the table main..I had it as main, but in the SQL query I used Main...so problem solved. Thank you.

Excellent, glad you worked it out!