[Help]Database issue

Hey,
When i try to import the esx_extended sql file i get the error

SQL Error (1044) Access denied for user
‘u1_JwatpUhzBn’@’%’ to database ‘es_extended’

So it seems like a database privilege issue.
Maybe some information you need,
I made my server in pterodactyl, and i made a database for it in pterodactyl the user that i want to use is made automaticly.

There is something wrong with my database but what i have no idea

This is my database structure at the moment

I also can’t seem to get my mysql async working

[mysql-async] [ERROR] connect ECONNREFUSED 127.0.0.1:3306

With the same database user a above

the line i use in my server.cfg,
set mysql_connection_string “user=u1_JwatpUhzBn;database=fivem;host=127.0.0.1;password=.x.x.x.x.”

Your database name in connection string is wrong, screenshot shows it should be

s1_Fivem

not ‘fivem’, try this:

mysql_connection_string “sslmode=none;server=127.0.0.1;port=3306;database=s1_Fivem;userid=u1_JwatpUhzBn;password=.x.x.x.x.”

also when you import the ESX sql you need to use database ‘s1_Fivem’ as well.

2 Likes

Thanks for your response,
sadly your idea is not working i tryed a driffrent ip but i still the same problem

image
This is the line i’m using now

set mysql_connection_string "mysql://u1_55o5qrO9kp:password@161.97.160.218/s1_fivem?charset=utf8mb4"
1 Like

If your dbhost is localhost(127.0.0.1) then trying to access a local mysql server via a remote URL won’t work. you’d want to connect to localhost.

I tryed them all my public ip
image
LocalHost
image
And my docker container ip
image
image
Even 0.0.0.0
image

just try localhost, no port, no IP, just localhost, and paste your connection string as it stands.

OK i tryed localhost, this is my connection string

set mysql_connection_string "mysql://u1_55o5qrO9kp:feoB7lEPIYAtuibPV0AgjT^W@localhost/s1_fivem?charset=utf8mb4"

This is the error message
image

The port 3306 is filled in automaticly
Maybe some other usefull information, i run my server in a docker image and im using phpmyadmin for the database

Your db name is s1_Fivem, not s1_fivem. Capitalization makes a difference.

I tryed your idea but still no luck

set mysql_connection_string "mysql://u1_55o5qrO9kp:feoB7lEPIYAtuibPV0AgjT^W@localhost/s1_Fivem?charset=utf8mb4"

image

We can keep on guessing for you but the other option is that you(the person with access to your mysql setup) can take the very simple step of learning your db access info. The person with the keys to the server is the person that should be determining this info.

Still a Problem? Here is the fix:

I finally figured it out: namely when you use Pterodactyl and use “localhost” or “127.0.0.1”, you call the container itself.

Very simple fix:
enter the following command in your SSH console:
ip addr | grep docker0

Then you should get something like this:


docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOW                                                           
N group default
inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0

and exactly this IP address 172.17.0.1 you use as your MySQL server. If you still get an error you should bind your MySql server to get the connections from outside, this you do as follows:

1. find /etc -iname my.cnf
2. nano /etc/mysql/my.cnf
3. at the bottom add this  

[mysqld]
bind-address=0.0.0.0

now you are ready and your FiveM server connects to the database! :grin:

1 Like

i need help brothr

i love u bro