Adding a remote MySQL user

First, log onto the local Mysql server (add the ‘-p’ switch if you have a root password assigned, or ‘-h hostname’ if it’s a remote server):

mysql -u root

Now add the user and update the privileges. To restrict to a single remote IP instead of any, replace ‘%’ with ‘1.2.3.4’, ect.

GRANT ALL PRIVILEGES ON *.* TO remoteuser@'%' IDENTIFIED BY 'remotepassword';
flush privileges;

Comments are closed.