# You can limit the number of records returned from the query, by using the "LIMIT" statement:

import sys
import mysql.connector

# Try connecting to database "mydatabase"
mydb = mysql.connector.connect(
    host="localhost",
    user="root",
    password="Somshona$1",
    database = "mydatabase", 
    auth_plugin = 'mysql_native_password'
)

mycursor = mydb.cursor()

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

myresult = mycursor.fetchall()

for x in myresult:
  print(x)
7ec7d46ce49c281358a366f60c92ad382b5bb84d
<mask token>

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

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

import sys
import mysql.connector
mydb = mysql.connector.connect(host='localhost', user='root', password=
    'Somshona$1', database='mydatabase', auth_plugin='mysql_native_password')
mycursor = mydb.cursor()
mycursor.execute('SELECT * FROM customers LIMIT 5')
myresult = mycursor.fetchall()
for x in myresult:
    print(x)

# You can limit the number of records returned from the query, by using the "LIMIT" statement:

import sys
import mysql.connector

# Try connecting to database "mydatabase"
mydb = mysql.connector.connect(
    host="localhost",
    user="root",
    password="Somshona$1",
    database = "mydatabase", 
    auth_plugin = 'mysql_native_password'
)

mycursor = mydb.cursor()

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

myresult = mycursor.fetchall()

for x in myresult:
  print(x)