> ( host = 'localhost', database = 'mysql', user = 'root', password = the available Database Password= (password set by me while installation of MyQL) Host= localhost (In general it is same for all)ĭatabase=mysql (You can set as per your wish) To establish a connection to the database we should know the following parameters, Type the following line of code > import nnector To verify the installation, you use the following steps: MySQL connector Error object is used to show us an error when we failed to connect Databases or if any other database error occurred while working with the database.Īfter installing the MySQL Python connector, we need to test it to make sure that it is working correctly, and you can connect to the MySQL database server without any problems. If the above code was executed with no errors, the we can say that “MySQL Connector” is installed properly and get ready to use of it.
The above line imports the MySQL Connector Python module in your program, so you can use this module’s API to connect MySQL.
#Install mysql in python install
So, in next we download the mysql-connector with use of pipĬ:\Users\Nitin Arvind Shelke>pip install mysql-connectorĪfter installation we test it whether it work or not, lets check with the following command > import nnector
#Install mysql in python driver
Python needs a MySQL driver to access the MySQL database. To check it wether nnector is available or not we type following command > import nnectorĪfter typing this we clearly say that No Module Named as a MySQL is present. MySQL Connector/Python is a standardized database driver provided by MySQL. MySQL Python Connector is used to access the MySQL database from Python, you need a database driver. MySQL is an open-source database, so you don’t have to pay for it.Ĭhoose the version number for MySQL community server which you want.MySQL is used for many small and big businesses.MySQL is a fast, easy to use relational database.MySQL is an open-source database, so you don’t have to pay a single penny to use it.It is developed, marketed and supported by MySQL AB, a Swedish company. It is currently the most popular open-source database