https://github.com/crispengari/mysql-python
🎨 this repository contains some mysql and python examples.
https://github.com/crispengari/mysql-python
mysql mysql-databases mysql-server python python-mysql-connector
Last synced: about 1 month ago
JSON representation
🎨 this repository contains some mysql and python examples.
- Host: GitHub
- URL: https://github.com/crispengari/mysql-python
- Owner: CrispenGari
- License: mit
- Created: 2022-08-23T19:22:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-09T06:06:59.000Z (over 2 years ago)
- Last Synced: 2025-03-27T17:02:42.295Z (about 1 month ago)
- Topics: mysql, mysql-databases, mysql-server, python, python-mysql-connector
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### MySQL Python
In this one we are going to learn how we can configure python to connect with mysql server.### Installing MSQL Connector
```shell
pip install mysql-connector-python
```### Testing the connection.
To test the connection create a python file and add the following code in it:```python
from mysql import connectorconfig ={
'host': '127.0.0.1' or 'localhost',
'user': 'root',
'password': 'root',
'database': 'todos',
'port': 3306
}
conn = connector.connect(**config)
# closing the connection
conn.close()
```### Refs
1. [w3schools](https://www.w3schools.com/python/python_mysql_getstarted.asp)
2. [dev.mysql.com](https://dev.mysql.com/doc/connector-python/en/connector-python-example-connecting.html)