I tried to access MySQL from Python 3.3 with the following methods:
import mysql.connector
config = {
\'user\': \'###\',
\'password\': \'******\',
\'h
You need to grant priviliges to your root user from MySQL, as your exception message said. Firstly, you login to your MySQL from the command line or from your favorite MySQL client (such as MySQL workbench.) Then you grant permission to your user (root, in this case). This link describes how to login to MySQL from the console, for example,
mysql -h localhost -u root -p
then you need to grant priviliges to user root, for example,
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
which gives full permissions for all databases from any host (%
) to root using a password. You need to be careful if this server is accessible from internet while granting permissions.