All Projects → PyMySQL → Pymysql

PyMySQL / Pymysql

Licence: mit
Pure Python MySQL Client

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Pymysql

Program O
PHP MySQL AIML Chatbot - One click installation. Fully loaded admin area to admin your chatbot. Set up multiple chatbots. Foreign language support. XML/JSON responses or just plain HTML. Massive community of users. Twitter Plugins and lots and lots more. Please feel free to fork the DEV branch and contribute. :)
Stars: ✭ 712 (-89.36%)
Mutual labels:  mysql
Mycat2
MySQL Proxy using Java NIO based on Sharding SQL,Calcite ,simple and fast
Stars: ✭ 750 (-88.8%)
Mutual labels:  mysql
Sqldef
Idempotent MySQL/PostgreSQL schema management by SQL
Stars: ✭ 762 (-88.62%)
Mutual labels:  mysql
Vue Koa Demo
🔰A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
Stars: ✭ 730 (-89.09%)
Mutual labels:  mysql
Weapsy
ASP.NET Core CMS
Stars: ✭ 748 (-88.83%)
Mutual labels:  mysql
Mall Swarm
mall-swarm是一套微服务商城系统,采用了 Spring Cloud Hoxton & Alibaba、Spring Boot 2.3、Oauth2、MyBatis、Docker、Elasticsearch、Kubernetes等核心技术,同时提供了基于Vue的管理后台方便快速搭建系统。mall-swarm在电商业务的基础集成了注册中心、配置中心、监控中心、网关等系统功能。文档齐全,附带全套Spring Cloud教程。
Stars: ✭ 7,874 (+17.63%)
Mutual labels:  mysql
Bifrost
Bifrost ---- 面向生产环境的 MySQL 同步到Redis,MongoDB,ClickHouse,MySQL等服务的异构中间件
Stars: ✭ 701 (-89.53%)
Mutual labels:  mysql
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (-88.42%)
Mutual labels:  mysql
Mybb
MyBB is a free and open source forum software.
Stars: ✭ 750 (-88.8%)
Mutual labels:  mysql
Usql
Universal command-line interface for SQL databases
Stars: ✭ 6,869 (+2.61%)
Mutual labels:  mysql
Mall Tiny
mall-tiny是一款基于SpringBoot+MyBatis-Plus的快速开发脚手架,拥有完整的权限管理功能,可对接Vue前端,开箱即用。
Stars: ✭ 738 (-88.98%)
Mutual labels:  mysql
Db Dumper
Dump the contents of a database
Stars: ✭ 744 (-88.89%)
Mutual labels:  mysql
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+15.21%)
Mutual labels:  mysql
Nopcommerce
The most popular open-source eCommerce shopping cart solution based on ASP.NET Core
Stars: ✭ 6,827 (+1.99%)
Mutual labels:  mysql
Eralchemy
Entity Relation Diagrams generation tool
Stars: ✭ 767 (-88.54%)
Mutual labels:  mysql
Baikaldb
BaikalDB, A Distributed HTAP Database.
Stars: ✭ 707 (-89.44%)
Mutual labels:  mysql
Thelia
Thelia is an open source tool for creating e-business websites and managing online content. Repo containing the new major version (v2)
Stars: ✭ 752 (-88.77%)
Mutual labels:  mysql
Xorm
Simple and Powerful ORM for Go, support mysql,postgres,tidb,sqlite3,mssql,oracle, Moved to https://gitea.com/xorm/xorm
Stars: ✭ 6,464 (-3.44%)
Mutual labels:  mysql
Dble
A High Scalability Middle-ware for MySQL Sharding
Stars: ✭ 774 (-88.44%)
Mutual labels:  mysql
Bookshelf
A simple Node.js ORM for PostgreSQL, MySQL and SQLite3 built on top of Knex.js
Stars: ✭ 6,252 (-6.6%)
Mutual labels:  mysql
Documentation Status https://coveralls.io/repos/PyMySQL/PyMySQL/badge.svg?branch=master&service=github https://img.shields.io/lgtm/grade/python/g/PyMySQL/PyMySQL.svg?logo=lgtm&logoWidth=18

PyMySQL

This package contains a pure-Python MySQL client library, based on PEP 249.

Requirements

  • Python -- one of the following:
  • MySQL Server -- one of the following:

Installation

Package is uploaded on PyPI.

You can install it with pip:

$ python3 -m pip install PyMySQL

To use "sha256_password" or "caching_sha2_password" for authenticate, you need to install additional dependency:

$ python3 -m pip install PyMySQL[rsa]

To use MariaDB's "ed25519" authentication method, you need to install additional dependency:

$ python3 -m pip install PyMySQL[ed25519]

Documentation

Documentation is available online: https://pymysql.readthedocs.io/

For support, please refer to the StackOverflow.

Example

The following examples make use of a simple table

CREATE TABLE `users` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `email` varchar(255) COLLATE utf8_bin NOT NULL,
    `password` varchar(255) COLLATE utf8_bin NOT NULL,
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
AUTO_INCREMENT=1 ;
import pymysql.cursors

# Connect to the database
connection = pymysql.connect(host='localhost',
                             user='user',
                             password='passwd',
                             database='db',
                             cursorclass=pymysql.cursors.DictCursor)

with connection:
    with connection.cursor() as cursor:
        # Create a new record
        sql = "INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)"
        cursor.execute(sql, ('[email protected]', 'very-secret'))

    # connection is not autocommit by default. So you must commit to save
    # your changes.
    connection.commit()

    with connection.cursor() as cursor:
        # Read a single record
        sql = "SELECT `id`, `password` FROM `users` WHERE `email`=%s"
        cursor.execute(sql, ('[email protected]',))
        result = cursor.fetchone()
        print(result)

This example will print:

{'password': 'very-secret', 'id': 1}

Resources

License

PyMySQL is released under the MIT License. See LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].