In Pi command line, connect to mysql as root user:
mysql -u root –p
Grant privileges to users:
GRANT ALL PRIVILEGES ON *.* TO user_name@'%' IDENTIFIED BY 'the_password';
This command will give all rights to user_name on all databases, ‘%’ represent the ip address (in this case all ip addresses).
To show the all the users granted in mysql:
select * from information_schema.user_privileges;