import mysql.connector

mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  password="",
  database="python_example"
)

mycursor = mydb.cursor()

mycursor.execute("SELECT * FROM customers LIMIT 5")

myresult = mycursor.fetchall()

for x in myresult:
  print(x) 

print("=======================")

#Start from position 3, and return 5 records:

mycursor.execute("SELECT * FROM customers LIMIT 5 OFFSET 2")

myresult = mycursor.fetchall()

for x in myresult:
  print(x) 
5f394fac384d6388283394369e3efffd7c274129
<mask token>

<mask token>
mycursor.execute('SELECT * FROM customers LIMIT 5')
<mask token>
for x in myresult:
    print(x)
print('=======================')
mycursor.execute('SELECT * FROM customers LIMIT 5 OFFSET 2')
<mask token>
for x in myresult:
    print(x)

<mask token>
mydb = mysql.connector.connect(host='localhost', user='root', password='',
    database='python_example')
mycursor = mydb.cursor()
mycursor.execute('SELECT * FROM customers LIMIT 5')
myresult = mycursor.fetchall()
for x in myresult:
    print(x)
print('=======================')
mycursor.execute('SELECT * FROM customers LIMIT 5 OFFSET 2')
myresult = mycursor.fetchall()
for x in myresult:
    print(x)

import mysql.connector
mydb = mysql.connector.connect(host='localhost', user='root', password='',
    database='python_example')
mycursor = mydb.cursor()
mycursor.execute('SELECT * FROM customers LIMIT 5')
myresult = mycursor.fetchall()
for x in myresult:
    print(x)
print('=======================')
mycursor.execute('SELECT * FROM customers LIMIT 5 OFFSET 2')
myresult = mycursor.fetchall()
for x in myresult:
    print(x)

import mysql.connector

mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  password="",
  database="python_example"
)

mycursor = mydb.cursor()

mycursor.execute("SELECT * FROM customers LIMIT 5")

myresult = mycursor.fetchall()

for x in myresult:
  print(x) 

print("=======================")

#Start from position 3, and return 5 records:

mycursor.execute("SELECT * FROM customers LIMIT 5 OFFSET 2")

myresult = mycursor.fetchall()

for x in myresult:
  print(x) 