Develop a Python script that connects to a MariaDB database, creates a table called "students" with columns "id", "name", and "age", and inserts 5 sample records into the table.
PLAINFORMAT
import mariadb

# Replace these values with your own credentials
user = 'your_username'
password = 'your_password'
host = 'localhost'
database = 'your_database'

# Connect to the database
conn = mariadb.connect(
    user=user,
    password=password,
    host=host,
    database=database
)

# Create a cursor object
cursor = conn.cursor()

# Create the students table
cursor.execute("""
CREATE TABLE IF NOT EXISTS students (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(255) NOT NULL,
    age INT NOT NULL
)
""")

# Insert 5 sample records into the students table
sample_students = [
    ('Alice', 20),
    ('Bob', 22),
    ('Charlie', 23),
    ('David', 21),
    ('Eve', 19)
]

for student in sample_students:
    cursor.execute("INSERT INTO students (name, age) VALUES (?, ?)", student)

# Commit the changes and close the connection
conn.commit()
conn.close()

print("Table created and sample data inserted successfully.")