Adding new enum column to an existing MySQL table using Python Last Updated : 25 Feb, 2021 Comments Improve Suggest changes Like Article Like Report Prerequisite: Python: MySQL Create Table In this article, we are going to see how to add a new enum column to an existing MySQL table using Python. Python allows the integration of a wide range of database servers with applications. A database interface is required to access a database from Python. MySQL Connector-Python module is an API in python for communicating with a MySQL database. Database table in use: We are going to use geeks(Database name) database and table describing the salary. Approach: Import module.Make a connection request with the database.Create an object for the database cursor.Execute the following MySQL query:ALTER TABLE table_name ADD colunm_name ENUM('field1','field2',...)And print the result. Below is the implementation with python: Python3 # Establish connection to MySQL database import mysql.connector db = mysql.connector.connect( host = "localhost", user = "root", password = "rot23", database = "geeks" ) # getting the cursor by cursor() method mycursor = db.cursor() query = "ALTER TABLE store ADD Department ENUM('Sweet','Snaks');" mycursor.execute(query) mycursor.execute(" desc store;") myresult = mycursor.fetchall() for row in myresult: print(row) db.commit() # close the Connection db.close() Output: Let's check on SQL shell: Comment More infoAdvertise with us Next Article Adding new enum column to an existing MySQL table using Python K kumar_satyam Follow Improve Article Tags : Python Python-mySQL Practice Tags : python Similar Reads Add comment to column in MySQL using Python MySQL server is an open-source relational database management system which is a major support for web-based applications. Databases and related tables are the main component of many websites and applications as the data is stored and exchanged over the web. In order to access MySQL databases from a 3 min read Inserting data into a new column of an already existing table in MySQL using Python Prerequisite: Python: MySQL Create Table In this article, we are going to see how to Inserting data into a new column of an already existing table in MySQL using Python. Python allows the integration of a wide range of database servers with applications. A database interface is required to access a 2 min read Adding a new NOT NULL column in MySQL using Python Prerequisite: Python: MySQL Create Table In this article, we are going to see how to add a new NOT NULL column in MySQL using Python. Python allows the integration of a wide range of database servers with applications. A database interface is required to access a database from Python. MySQL Connecto 2 min read How to Copy a Table in MySQL Using Python? In this article, we will create a table in MySQL and will create a copy of that table using Python. We will copy the entire table, including all the columns and the definition of the columns, as well as all rows of data in the table. To connect to MySQL database using python, we need PyMySql module. 3 min read How to Add a Column to a MySQL Table in Python? Prerequisite: Python: MySQL Create Table Python allows the integration of a wide range of database servers with applications. A database interface is required to access a database from Python. MySQL Connector-Python module is an API in python for communicating with a MySQL database. Â ALTER statemen 4 min read Like