This is actually a good restriction. As a general thumb of rule, you should not use the root account for the applications.
Create another user, set the privileges accordingly and use that account from your application.
Connect to the database:
sudo mysql -u root -p
Then create the user:
CREATE USER 'bob'@'localhost' IDENTIFIED BY 'bobpasswd'; GRANT ALL PRIVILEGES ON * . * TO 'bob'@'localhost';