The permissions on the MySQL server will need to be configured to accept connections to the specific MySQL database via the MySQL username you specify, and to do the specific operations you need (e.g. insert, create tables). this is a common wall to hit when first using MySQL.
I assume you can connect to MySQL using:
shell> mysql --user=root mysql
Then try a variation of:
mysql> GRANT ALL PRIVILEGES ON *.* TO username@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES;