Software testing|A detailed guide to accessing MySQL databases using PyMySQL

Introduction PyMySQL is a popular MySQL database driver in Python that provides convenient methods to connect, query, and update MySQL databases. This article will provide you with a detailed guide to using PyMySQL to access the MySQL database, including installing PyMySQL, connecting to the database, performing query and update operations, etc. For more technical information, […]

Python-based interface automation – pymysql module to operate database

Directory introduction 1. PyMySQL installation 2. Python operates the database write at the end Introduction When performing functional or interface testing, it is often necessary to connect to the database, operate and view relevant data table data, and use it to build test data, check functions, verify data consistency, and whether the database operation of […]

pymysql of Python series modules operates MySQL database

Directory 1. Install pymysql Two, connect to the database 3. Database operation 3.1 Query 3.2 update 3.3 Batch update using loop Python series article learning record: Windows environment installation and configuration of Python series Variables and operators of Python series Judgment and cycle of Python series – Blog – CSDN Blog Python series of strings […]

pymysql database tools (private version)

1. mysql.py import pymysql class MySql: def __init__(self, operate_tablename: str, my_sqldb_config_param: dict): assert isinstance(my_sqldb_config_param, dict), “Please pass in the format of dictionary type!” self._operate_tablename = operate_tablename try: self._conn = pymysql.connect(**my_sqldb_config_param) # connect to the database, configuration parameters self._cursor = self._conn.cursor() # Create a cursor to execute the query self._get_field() # Get the field name in […]

Encapsulate Python script: use pymysql+sshtunnel to support connecting to mysql database through SSH tunnel

1. Foreword Usually in order to ensure the security of the database, direct connection to the database is not allowed, but the database behind the server needs to be connected through the SSH tunnel; The operation through Navicat is as follows: 2. python package script # -*- coding: utf-8 -*- # @Time : 2023/5/12 11:04 […]

pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that co

pymysql.err.ProgrammingError: (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘CREATE TABLE `sinatop20` ( `snid` int( 11) NOT NULL AUTO_INCREMENT, `id` varchar(‘ at line 1”) For the analysis of the error report: it is obvious that this is […]

[MySQL Quick Guide 003] MySQL views, MySQL triggers, MySQL functions, MySQL stored procedures (parameter classification, addition, deletion, modification and query of stored procedures, etc.), dynamic execution of SQL, stored procedures that support transactions, pymysql

Blog Outline This 4D blog mainly includes my understanding of: MySQL views, MySQL triggers, MySQL functions, MySQL stored procedures (parameter classification, addition, deletion, modification and query of stored procedures, etc.), SQL dynamics Execution, the summary of stored procedures that support transactions, pymysql, etc., can be described as very detailed? After all, the article is so […]

Installation and operation of pymysql

1. pymysql installation 1.1 Conda environment interpreter online installation Run Terminal as administrator or use Anaconda Powershell Prompt and run as administrator conda install -c conda-forge pymysql Note: After conda installs pymysql, it can only be called by using the conda interpreter 1.2 Online installation of Python environment 1. Find the python installation location, open […]

Basic use of PyMySql through Jupyter

Summary Safely start MySQL + Jupyter lab + Conda services on a virtual machine Implementing PyMySQL in Jupyter to realize the development of SQL statements Important points: pandas + pymysql + sqlalchemy Official Documentation pymysql sqlalchemy Python Strings | Runoob Tutorial (runoob.com) Basic usage pymsql-conn + cursor import pymysql import pandas as pd # define […]