Skip to main content
11 events
when toggle format what by license comment
Jun 28 at 7:08 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Jun 19, 2023 at 11:27 answer added fcm timeline score: 0
Aug 5, 2019 at 4:44 comment added Wolfeatspotatoes Thank you for this, but I don't think the error is from my python code as the code is given by my lecturer and other student is able to use it without a problem. I have consulted my lecturer and she seems to suggest that there might be a bug in the MySQL side.
Aug 5, 2019 at 4:41 comment added Vomit IT - Chunky Mess Style Here's an example of a way I've run MySQL queries on Windows machines using Python sort of how you are doing it.... pastebin.com/SkkfKvbu Although it is a dumbed down version and I'm sure I should be closing the cursor too so obviously it'll need fine tuned and tested more. Here's a reference link I used to build the logic if my notes are accurate: ianhowson.com/blog/a-quick-guide-to-using-mysql-in-python. Try using 127.0.0.1 instead of localhost and see if that makes any difference. Also, try all variations of those values with double quotes rather than single quotes too.
Aug 5, 2019 at 4:18 comment added Wolfeatspotatoes The thing is it was working fine a week ago, but then i executed it again this morning and it returns nonetype error.
Aug 5, 2019 at 4:16 comment added Wolfeatspotatoes I just tried cnx = mysql.connector.connect(user='root', password='12345', host='localhost', database='ca2database') But it still produces the same output. And i need the ' quotation if not it will say the variable is not defined.
Aug 5, 2019 at 4:05 comment added Vomit IT - Chunky Mess Style So you are connecting localhost yet the arg passed equals 127.0.0.1? The MySQL security for root is host part specific usually so this may matter. Outside of the Python connection, can you access the MySQL instance as root and check security to see how it is configured? I'd guess your pw arg is null too. Unfortunately I don't know pandas very well either.
Aug 5, 2019 at 3:56 comment added Wolfeatspotatoes thanks for answering, i have updated the code and show picture of the data in sql
Aug 5, 2019 at 3:56 history edited Wolfeatspotatoes CC BY-SA 4.0
added 415 characters in body
Aug 5, 2019 at 3:45 review First posts
Aug 9, 2019 at 10:12
Aug 5, 2019 at 3:42 history asked Wolfeatspotatoes CC BY-SA 4.0