Allow remote access to MySQL 8 server
11 March 2022 (Updated 27 May 2024)
Login as root
Login as root (however you’ve configured root login).
Create a user
You’ll typically want to create a separate user for each application so consider naming the user the same as the application. Use a password generator to create a strong password.
Grant privileges
Verify new user was created
This should output something like:
Exit MySQL.
Allow remote access (optional)
Edit /etc/mysql/mysql.conf.d/mysqld.cnf
and comment out the following line:
This ensures that users can login from other IP addresses. Ensure your firewall (if you have one) allows remote access to port 3306
.
Restart MySQL server
Login with new credentials
From your local machine:
Tagged:
MySQL
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment