https://github.com/barisertugrul/mysql-to-json
This project converts all tables in a MySQL database to JSON files.
https://github.com/barisertugrul/mysql-to-json
Last synced: 2 months ago
JSON representation
This project converts all tables in a MySQL database to JSON files.
- Host: GitHub
- URL: https://github.com/barisertugrul/mysql-to-json
- Owner: barisertugrul
- License: gpl-3.0
- Created: 2024-12-10T21:29:18.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-12-10T21:45:58.000Z (6 months ago)
- Last Synced: 2025-02-11T11:52:42.039Z (4 months ago)
- Language: Python
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MySQL to JSON Converter
This project converts all tables in a MySQL database to JSON files.
## Requirements
- Python 3.x
- `mysql-connector-python` library## Installation
1. Clone the repository:
```sh
git clone https://github.com/barisertugrul/mysql-to-json.git
cd mysql-to-json
```2. Install the required Python packages:
```sh
pip install mysql-connector-python
```## Usage
1. Update the MySQL connection parameters in `mysql_to_json.py`:
```python
config = {
'host': 'localhost',
'user': 'root',
'password': '',
'database': 'northwind'
}
```
2. Change the `output_folder` variable to the desired output directory:
```python
output_folder = 'output_dir'
```3. Run the script:
```sh
python mysql_to_json.py
```4. JSON files will be saved in the `output_folder` folder.
## License
This project is licensed under the GPL License.