print(conn this results in the same successful connection to the mysql serverbut the difference is that the connection method no longer exposes any mission-critical information nowplacing the same usernamepassworddatabaseand so on into dictionary in the same python module does not eliminate the risk of having the credentials seen by any one per using the code in order to increase database securitywe first move the dictionary into its own python module let' call the new python modulg euidbconfig py we then import this module and unpack the credentialsas we did before import guidbconfig as guiconf unpack dictionary credentials conn mysql connect(**guiconf dbconfigprint(conn now that we know how to connect to mysql and have administrator privilegeswe can create our own database by issuing the following commands guidb 'guidbunpack dictionary credentials conn mysql connect(**guiconf dbcon figcursor conn cursor(trycursor execute("create database {default character set 'utf 'format(guidb)except mysql error as errprint("failed to create db{}format(err)conn close( in order to execute commands to mysqlwe create cursor object from the connection object cursor is usually place in specific row in database tablewhich