https://github.com/hecdelatorre/pythonmysqlconnector
https://github.com/hecdelatorre/pythonmysqlconnector
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hecdelatorre/pythonmysqlconnector
- Owner: hecdelatorre
- License: gpl-3.0
- Created: 2021-07-28T23:09:01.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-15T23:26:38.000Z (over 3 years ago)
- Last Synced: 2025-01-10T06:21:15.709Z (6 months ago)
- Language: Python
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Python - mysql connector
Necessary libraries
```
pip install mysql-connector-python
```
```ssh
pip install simple-term-menu
```



* Create database
```sql
CREATE DATABASE prueba;
```
```sql
USE prueba;
```
* Create table
```sql
CREATE TABLE `Usuario` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`age` int(3) DEFAULT NULL,
PRIMARY KEY (`id`)
);
```
* Insert data
```sql
INSERT INTO Usuario (username, email, age)
VALUES('user', '[email protected]', 18);
```
* Select
```sql
SELECT * FROM Usuario;
```
```sql
SELECT * FROM Usuario WHERE id = 1;
```
[](https://github.com/Hec98)