Add new MySQL user for remote access

How to add new MySQL user for remote access?

To enable remote access for mysql, we should follow these simple steps:
1. Open port 3306  to enable remote connection
2. Login to your mysql with this command
mysql -u root -p
And then create a new user and grant access
CREATE USER 'username'@'%' IDENTIFIED BY 'userpass';
GRANT ALL ON *.* TO 'username'@'%';
FLUSH PRIVILEGES;
Add new MySQL user for remote access

How to add new MySQL user for remote access?

Join The Ride

Subscribe to our fortnightly newsletter with stories from our latest adventures and the best travel tips

Table of Contents