MySQL - Allow all remote connections, MySQL - (readonly and admin)
http://stackoverflow.com/questions/10236000/allow-all-remote-connections-mysql
Important Note:
You CAN’T grant permissions if you are not logged in as localhost.
It will give you an error such as: Mysql - Access denied for user 'root'@'x.x.x.x'
If you want to do it remotely you MUST login using the SSH option. That will make you log in as the localhost.
To Grant ALL privileges to remote user (NOT RECOMMENDED. DON'T DO IT)
GRANT ALL ON *.* to user@'%' IDENTIFIED BY 'password’;
To See all database users
SELECT * FROM mysql.user;
To Drop a user
DROP USER 'root'@'%';
To create new remote user with the name alon
and password 123456
CREATE USER 'alon'@'%' IDENTIFIED BY '123456';
To grant root privileges to a user from a specific ip address
GRANT ALL ON *.* to 'root'@'110.140.194.8' IDENTIFIED BY '123456';
HOW TO GRANT READ ONLY PRIVILEGES TO USER
http://serverfault.com/questions/115950/how-do-i-change-the-privileges-for-mysql-user-that-is-already-created
revoke all privileges on *.* from 'user'@'host';
grant SELECT ON `db_name`.* TO 'user'@'host';
flush privileges;