Remote connect to MySQL 8.0.23 for root

Issues related to applications and software problems
Post Reply
Igor2003
Posts: 5
Joined: 2021/01/28 18:17:16

Remote connect to MySQL 8.0.23 for root

Post by Igor2003 » 2021/01/29 11:06:23

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?

User avatar
TrevorH
Forum Moderator
Posts: 30314
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Remote connect to MySQL 8.0.23 for root

Post by TrevorH » 2021/01/29 13:12:45

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.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Igor2003
Posts: 5
Joined: 2021/01/28 18:17:16

Re: Remote connect to MySQL 8.0.23 for root

Post by Igor2003 » 2021/01/29 14:59:56

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

User avatar
TrevorH
Forum Moderator
Posts: 30314
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Remote connect to MySQL 8.0.23 for root

Post by TrevorH » 2021/01/29 15:48:22

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".
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Igor2003
Posts: 5
Joined: 2021/01/28 18:17:16

Re: Remote connect to MySQL 8.0.23 for root

Post by Igor2003 » 2021/01/29 17:44:50

Thank you again Trevor
I followed your advice and created additional user and granted it the relevant permission.

Post Reply

Return to “CentOS 7 - Software Support”