Connect to a MySQL DB in python

0 votes
How do I connect to a MySQL DB in python?
Jul 20, 2018 in Python by kaalabilli
• 1,090 points
758 views

1 answer to this question.

0 votes
db = MySQLdb.connect(host="localhost",    # your host, usually localhost
                     user="john smith",         # your username
                     passwd="xxxtentacion",  # your password
                     db="junkdb")        # name of the data base

answered Jul 20, 2018 by Nietzsche's daemon
• 4,260 points

Related Questions In Python

0 votes
2 answers

How do I connect to a MySQL Database in Python?

connect mysql database with python import MySQLdb db = ...READ MORE

answered Mar 28, 2019 in Python by rajesh
• 1,270 points
1,854 views
0 votes
1 answer

Connect to a MySQL using Python?

Very similar to mysqldb but better than ...READ MORE

answered Nov 16, 2018 in Python by Jino
• 5,820 points
697 views
0 votes
1 answer

Question on PyQt: How to connect a signal to a slot to start a background operation in Python

It shouldn't matter whether the connection is ...READ MORE

answered Nov 27, 2018 in Python by Nymeria
• 3,560 points
1,714 views
0 votes
1 answer

How to add a new line in Python?

You can use '\n' for a next ...READ MORE

answered May 2, 2018 in Python by aayushi
• 750 points
1,246 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,398 views
0 votes
1 answer
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,790 points
4,008 views
0 votes
1 answer

Adding elements to a list in python

Use extend() instead: l = [5, 7, 12, ...READ MORE

answered Apr 23, 2018 in Python by Nietzsche's daemon
• 4,260 points
798 views
+4 votes
7 answers

Splitting a List into chunks in Python

Here's a generator that yields the chunks ...READ MORE

answered Apr 13, 2018 in Python by Nietzsche's daemon
• 4,260 points
35,361 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP