sscasc@tumkur to retrieve selected row or rowswe need to introduce where clause at the end of the select statement where clause filters the results according to the condition in the clause here is simple where clausesmysql select from fruit where name 'banana'connecting python with database install mysql connector python using pip use the mysql connector connect(method of mysql connector python with required parameters to connect mysql use the connection object returned by connect(method to create cursor object to perform database operations the cursor execute(to execute sql queries from python close the cursor object using cursor close(and mysql database connection using connection close(after your work completes catch exception if any that may occur during this process creating connection object nowwe are ready to issue commands interacting with the database many sql commands can be issued using single function ascursor execute(closing the database after all changes have been committedwe can then close the databasemydb close(python mysql database connection program import mysql connector this line imports the mysql connector python module in to program and we can use this module' api to connect mysql from mysql connector import error 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 example er_access_denied_error when username or password is wrong mysql connector connect(using this function we can connect the mysql databasethis function accepts four required parametershostdatabaseuser and password that we already discussed sp_python programming