Mar-24-2021, 01:41 AM
(This post was last modified: Mar-24-2021, 01:41 AM by kingceasarr.)
hii i dont understand what you meant brother and is it normal i cant msg you?
any good good site for tut on python?
and i have now made small changes to my dbs connect file can you look at it for me and in small explain to me that if the program connects or not how continue to last dbs in opend file and not stop after check one
any good good site for tut on python?
and i have now made small changes to my dbs connect file can you look at it for me and in small explain to me that if the program connects or not how continue to last dbs in opend file and not stop after check one
import MySQLdb import MySQLdb._exceptions import sys, os, requests with open("datafile.txt", "r") as lijst: for line in lijst: lijst.readline connection = eval('MySQLdb.connect({})'.format(lijst.readline().strip())) print(connection)
Error:C:\Users\Gebruiker\Downloads\V1>python3 *****.py
<_mysql.connection open to 'localhost' at **********>
Traceback (most recent call last):
File "C:\Users\Gebruiker\Downloads\V1\****.py", line 8, in <module>
connection = eval('MySQLdb.connect({})'.format(lijst.readline().strip()))
File "<string>", line 1, in <module>
File "C:\Users\Gebruiker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\MySQLdb\__init__.py", line 130, in Connect
return Connection(*args, **kwargs)
File "C:\Users\Gebruiker\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\MySQLdb\connections.py", line 185, in __init__
super().__init__(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2002, "Can't connect to MySQL server on 'localhost' (10060)")