If you are in need of remote access to mysql 8 remotely, you can follow the following instructions:
Change MySQL Configuration
By default MySQL will disable the remote feature, you need to enable it by opening the MySQL configuration file and adjusting the following:
vi /etc/my.cnf
Change the following line
bind-address = 127.0.0.1
skip-networking
Wall
Restart MySQL
service mysql restart
Decentralize remote access MySQL
By default, MySQL is only authorized to access from local, so you need to update a few more steps to be able to connect from the outside:
MySQL Login
mysql -u root -p
Starting with MySQL 8, you can no longer (implicitly) create users with the GRANT command. Use CREATE USER instead, followed by a GRANT statement:
Run the command below to allow root user access from all machines
CREATE USER 'root'@'%' IDENTIFIED BY 'PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
In case you only want to allow access from IP, you can change % to IP, can be run multiple times to allow access from multiple IPs for example under allow IP 1.2.3.4
GRANT ALL PRIVILEGES ON *.* TO 'root'@'1.2.3.4' WITH GRANT OPTION;
In some cases, low client access may cause errors:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
to fix run the following command
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'PASSWORD';
FLUSH PRIVILEGES;
Thank you customer
Post a Comment
Post a Comment