This is MySQL Python programming tutorial with the MySQLdb module. The examples were created and tested on ArchLinux.
- Ver. Python = 2.0
- Ver. DataBase = 10.1.30-MariaDB
- Editor = Vim
- Insert following sentences on mariadb/mysql:
- mysql -u root -p
- CREATE DATABASE vengadores;
- CREATE USER 'nickFury'@'localhost' IDENTIFIED BY 'shield';
- USE vengadores;
- GRANT ALL ON vengadores.* TO 'nickFury'@'localhost';
- quit;
- run: "_mysql_dbmodule.py"
- run: "_mysqldb_createTable.py"
- run: "_mysqldb_retrievingData.py"
- run: "_mysqldb_retrievingData2.py"
- run: "_mysqldb_dictionaryCursor.py"
- run: "_mysqldb_columHeaders.py"
- run: "_mysqldb_preparedStatments.py"
- Insert sentence on mariadb:
- CREATE TABLE Images (Id INT PRIMARY KEY, Data LONGBLOB);
- NOTE: You need a image for next sample named "viuda.jpg" stored on your script directory (max=1MB)
- run: "_mysqldb_insertingImages.py"
- run: "_mysqldb_readingImages.py"
- run: "_mysqldb_transactionSupport.py"