Write a simple Python script that accepts user input for a date range and queries a MySQL database to retrieve records within that date range, displaying the results in a formatted table.

To create a simple Python script that accepts user input for a date range and queries a MySQL database to retrieve records within that date range, you can use the following code:

```python
import mysql.connector
from tabulate import tabulate
from datetime import datetime

# Connect to the MySQL database
cnx = mysql.connector.connect(
    host="your_host",
    user="your_user",
    password="your_password",
    database="your_database"
)

cursor = cnx.cursor()

# Get user input for the date range
start_date_input = input("Enter start date (YYYY-MM-DD): ")
end_date_input = input("Enter end date (YYYY-MM-DD): ")

# Convert the user input to datetime objects
start_date = datetime.strptime(start_date_input, "%Y-%m-%d")
end_date = datetime.strptime(end_date_input, "%Y-%m-%d")

# Query the database for records within the specified date range
query = """
SELECT * FROM your_table_name
WHERE your_date_column BETWEEN %s AND %s;
"""

cursor.execute(query, (start_date, end_date))

# Fetch all rows from the result of the query
rows = cursor.fetchall()

# Display the results in a formatted table using the 'tabulate' library
print("\nResults:")
headers = [i[0] for i in cursor.description]
print(tabulate(rows, headers=headers, tablefmt="grid"))

# Close the cursor and connection
cursor.close()
cnx.close()
```

Replace `your_host`, `your_user`, `your_password`, `your_database`, `your_table_name`, and `your_date_column` with the appropriate values for your MySQL database.

You will also need to install the `mysql-connector-python` and `tabulate` libraries if you haven't already. You can do this by running:

```
pip install mysql-connector-python tabulate
```

This script will prompt the user to enter a start date and an end date in the format "YYYY-MM-DD". It will then query the MySQL database for records within that date range and display the results in a formatted table.