Skip to content

duhnk/RowdyMiracleData

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

RowdyMiracleData

This was a miracle of data

📚 CSV to MySQL Uploader

This script allows you to automatically create a table in your MySQL database and populate it using data from a CSV file.

🛠️ Setup

  1. Dependencies:

    • Python 3.x
    • mysql-connector-python

    Install the required module using:

    pip install mysql-connector-python
  2. Configuration:

    Before running the script, make sure to modify the config dictionary in the script:

    config = {
        'user': 'YOUR USER NAME',
        'password': 'YOUR PASSWORD',
        'host': 'YOUR HOST',
        'database': 'YOUR DATABASE NAME'
    }
  3. CSV File:

    Ensure that your CSV file is formatted correctly to match the table structure defined in the script. Update the file path and encoding format in this line:

    with open('PATH/YOURFILE.csv', 'r',encoding='YOUR FILE FORMAT', errors='replace') as file:

🚀 Usage

Simply run the script using:

python your_script_name.py

💡 Tips

  • Make sure to have a backup of your database before running the script, especially if you are working in a production environment.
  • Handle your credentials securely. Consider using environment variables or secrets management tools instead of hardcoding them in the script.

📝 Notes

  • The script will automatically drop the table named rowdyT1 if it exists and create a new one.
  • Errors encountered during the insertion of rows from the CSV will be printed to the console.

🤝 Contribution

Feel free to fork this repository, make changes, and submit Pull Requests. For major changes, please open an issue first to discuss what you'd like to change.

⭐ Feedback

If you find any bugs or would like to suggest new features, please open an issue. Feedback is always welcome!

📄 License

This project is licensed under the MIT License - see the LICENSE.md file for details.


About

This was a miracle of data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages