Python Forum
Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector?
#1
Exclamation 
Hello again everyone! Admins, Mods (Thank you again for the prior threads, btw).

I am now up against parsing a huge amount of Data and the only way to do so is by learning Python.

I figure I would start with this thread; as I am at a stuck point with MySQL Connectors working with Debian 10 Buster and Python 3.x (No matter the solution; I cannot seem to get it working). Even the code from Oreilly Web Scraping with Python didn't work (I bought the Book).

Continuing;

I feel the best way to resolve this is to use a base line foundational block found from W3 Schools here https://www.w3schools.com/python/python_mysql_getstarted.asp

Code found in that block for Python Connector to MySQL is :
import mysql.connector

mydb = mysql.connector.connect(
  host="localhost",
  user="yourusername",
  password="yourpassword"
)

print(mydb) 
This is what happens when I run it:

python3 w3.mysql.python.connector.py 
Traceback (most recent call last):
  File "w3.mysql.python.connector.py", line 1, in <module>
    import mysql.connector
  File "/home/brandon/.local/lib/python3.5/site-packages/mysql/connector/__init__.py", line 54, in <module>
    from .connection import MySQLConnection
  File "/home/brandon/.local/lib/python3.5/site-packages/mysql/connector/connection.py", line 451
    f"This connection is using {tls_version} which is now "
                                                          ^
SyntaxError: invalid syntax
“And one of the elders saith unto me, Weep not: behold, the Lion of the tribe of Juda, the Root of David, hath prevailed to open the book,...” - Revelation 5:5 (KJV)

“And oppress not the widow, nor the fatherless, the stranger, nor the poor; and ...” - Zechariah 7:10 (KJV)

#LetHISPeopleGo

Reply


Messages In This Thread
Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector? - by BrandonKastning - Nov-19-2021, 06:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,400 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
Question Securing State Constitutions (USA) from University of Maryland > MariaDB .sql BrandonKastning 1 1,495 Jan-21-2022, 06:34 PM
Last Post: BrandonKastning
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,819 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 2,783 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Python Obstacles | Karate | HTML/Scrape Specific Tag and Store it in MariaDB BrandonKastning 8 3,091 Nov-22-2021, 01:38 AM
Last Post: BrandonKastning
  mod-python in apache2 on debian 9 xstation 6 3,759 Jun-15-2020, 01:29 PM
Last Post: DeaD_EyE
  Build a simple Webapp with Python Flask and mariaDB newbie1 3 3,317 Jun-04-2020, 09:34 PM
Last Post: lmolter54
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to write 3 Columns to MariaDB? BrandonKastning 21 6,718 Mar-23-2020, 05:51 PM
Last Post: ndc85430
  [Flask] Create new project for add user,edit,delete,view users in python with mysql connector chandranmanikandan 0 7,294 Oct-30-2018, 10:19 AM
Last Post: chandranmanikandan
  Eclipse Python We development Environment Adelton 3 4,533 Feb-16-2017, 08:52 PM
Last Post: Adelton

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020