![]() ![]() ![]() Sql_0 = "CREATE TABLE IF NOT EXISTS `users` (`Id` INT NOT NULL AUTO_INCREMENT, `email` VARCHAR(500) NULL, `password` VARCHAR(500) NULL, PRIMARY KEY (`Id`)) COLLATE='utf8_general_ci' ENGINE=InnoDB " Create a new record and Read a single record The rest of the code we will create a Table if not exist named "users" with three columns Id, email and password. ![]() Open Windows PowerShell or Terminal in Linux and type pip install PyMySQLĪfter this pyMySQL installation you're ready to connect your MySQL server first import pymysql.cursor import pymysql.cursorsĬonnect to the database with your login credentials (Username, Password and Database Name) connection = nnect(host='localhost', You can install pip, by following the instructions. This is a long way to do job, you may and here i will use the pip Python Package Index and PyMySQL. First things first you should download and install appropriate MySQL python connector for Windows/Linux/Mac OSx from here. I assume you're using python 3.5 or above. Here i describe the basics of connecting a MySQL server with python. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |