Host is not allowed to connect to this MySQL server!

I made my first ESX server on a Linux VPS and have gone through a lot of errors and I am not letting this be the one that stops me. When I start up the server it says

ERROR] ER_HOST_NOT_PRIVILEGED: Host 'LINUXVPSIP' is not allowed to connect to this MySQL server
(node:30506) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.
(node:30506) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Please use clearTimeout instead.
[ERROR] [MySQL] [es_extended] An error happens on MySQL for query "SELECT * FROM items": ER_HOST_NOT_PRIVILEGED: Host 'LINUXVPSIP' is not allowed to connect to this MySQL server
[ERROR] [MySQL] [es_extended] An error happens on MySQL for query "SELECT * FROM jobs": ER_HOST_NOT_PRIVILEGED: Host 'LINUXVPSIP' is not allowed to connect to this MySQL server
SCRIPT ERROR: @es_extended/server/common.lua:23: bad argument #1 to 'for iterator' (table expected, got nil)
> ref (@es_extended/server/common.lua:23)
>  (@mysql-async/mysql-async.js:14431)
SCRIPT ERROR: @es_extended/server/common.lua:35: attempt to get length of a nil value (local 'result')
> fn (@mysql-async/lib/MySQL.lua:197)

If anyone can help me get through this error it would be very much appreciated!

Other Notes:
Linux VPS
Debian 10 (Buster)
I made sure to check if the name and password is right like 3 times.

Sorry to say bud.
But the user you are running on, LINUXVIPIP, does not have permissions to access the DB.

Based on the error there are a number of potential problems, it would be hard to troubleshoot without more information.

Are you running on a screen?
Are you starting up FiveM as Root or as a Sudo Root User?
Have you ensured your password and username to connect to the DB are correct?
Does that DB accept connections from that Username?

So on and so fourth.
Hope it prompts you in the right direction to look.

Normally you have to configure it to support remote connections and then give users a password to avoid problems. I do not remember the steps exactly, I have not done it for a long time.

Figured it out guys! For future reference to anyone having this problem, I did the following command ALTER USER ‘USERINSERVER.CFG’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘PASSWORD’;

1 Like

Hey there! Do you know the solution to this? I think you might have solved it. Thanks.
Script Error: @es_extended/server/common.lua:23: bad argument #1 to ‘for iterator’ (table expected, got nil)
ref (@es_extended/server/common.lua:23)