Page 1 of 1

Remote connect to MySQL 8.0.23 for root

Posted: 2021/01/29 11:06:23
by Igor2003
I just installed MySQL 8.0.23
I need to manage MySQL remotely with Workbench.
Getting can't connect to MySQL server on 'server_ip' (10061)

I know that a remote access for root is far away from being a good approach but I need it like this.
How can I allow remote permissions for root?

Re: Remote connect to MySQL 8.0.23 for root

Posted: 2021/01/29 13:12:45
by TrevorH
How can I allow remote permissions for root?
That has nothing to do with the question you are asking.

To connect to mysql remotely you need to do several things: open the port (tcp 3306) in the firewall, perferably locked down to a single ip adress or subnet, grant mysql permission to that user from that ip/suibnet via the mysql command line client. To do those things only requires root to be able to open the firewall port.

Re: Remote connect to MySQL 8.0.23 for root

Posted: 2021/01/29 14:59:56
by Igor2003
Thank you Trevor

Given the firewall is not an issue in my case should the following command do the job:

Code: Select all

GRANT ALL ON *.* to root@'100.168.%.%' IDENTIFIED BY 'my-root-password';
Thanks

Re: Remote connect to MySQL 8.0.23 for root

Posted: 2021/01/29 15:48:22
by TrevorH
It would work but I'd not use the root username for it. And if you want a user with the same abilities as the actual mysql root user then you need to add "WITH GRANT OPTION".

Re: Remote connect to MySQL 8.0.23 for root

Posted: 2021/01/29 17:44:50
by Igor2003
Thank you again Trevor
I followed your advice and created additional user and granted it the relevant permission.