How to enable remote access for users in MySQL database

Viewed 11

I have a MySQL account, but I can only access it internally using 127.0.0.1. How can I enable remote access for users in a MySQL database so that I can use my local computer to access the database on the server

1 Answers

Log in to your MySQL using root or other administrator users:

mysql -u root -p123456
MySQL>use mysql;
MySQL>GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION ;
MySQL>FLUSH PRIVILEGES;

Taking the root user as an example, you can replace it with your own user