"Host XXX is not allowed to connect to this MySQL server" change XXX for another name

Hello. When connecting to mysql, I receive the error "Host XXX is not allowed to connect to this MySQL server". So my question is how can I change the name "XXX". The host name on XXX is very long and I want to change it for another more understandable.

Thanks.

4 Replies

Hello,

Assuming you are trying to connect remotely, you need to create the MySQL user with the specific host, something like:

GRANT ALL PRIVILEGES ON dbname.* TO 'dbuser'@'Host XXX' IDENTIFIED BY 'password' WITH GRANT OPTION;

Yes, but I don't ask for the solution about how to connect, but I ask for how to change the "XXX" hostname.

Hello,

It depends on the distro you are using, rename it with: "hostname newname" and then edit /etc/sysconfig/network for CentOS/RHEL or /etc/hostname for Debian/Ubuntu

You can change it with those hostname command given you're package is up to date.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct