SA-MP Forums Archive
Host mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Host mysql (/showthread.php?tid=605163)



Host mysql - saffierr - 15.04.2016

Hello, I have a host, but as my script was like this:

PHP код:
#define MYSQL_HOST "localhost"
#define MYSQL_USER "root"
#define MYSQL_DATABASE "mydb"
#define MYSQL_PASSWORD "" 
It couldn't connect to it, so I did some research and I saw that I had to change the MYSQL_HOST "localhost" to MYSQL_HOST "myserverip". Well I did that, and it was good. but the next problem is the MYSQL_USER "root"...
I assume the "root" should be replaced with something else to get it working.

Any help is appreciated.


Re: Host mysql - Eyce - 15.04.2016

All of the details that you need in order to connect to your MySQL server should be provided by your host. If they haven't, you can probably send a ticket requesting for your MySQL username and password though it's usually found on the details of your account. If you're using a VPS or dedicated server, you would have to create your own through the control panel or again, have it requested.


Re: Host mysql - saffierr - 15.04.2016

I see, thank you for the info as I haven't paid attention to that.
I changed everything based on the host yet I can't connect to it.
The Mysql_log.txt says:


Re: Host mysql - Eyce - 15.04.2016

Quote:
Originally Posted by saffierr
Посмотреть сообщение
I see, thank you for the info as I haven't paid attention to that.
I changed everything based on the host yet I can't connect to it.
The Mysql_log.txt says:
Based on my experience and from the errors that you've posted, there's something wrong with the password. If the password you're using right now is the default one, ask your host to reset it to something you want. And make sure that you don't interchange the username and database name.


Re: Host mysql - saffierr - 15.04.2016

Which password do you mean??
I can't even register on my server


Re: Host mysql - Eyce - 15.04.2016

Quote:
Originally Posted by saffierr
Посмотреть сообщение
Which password do you mean??
I can't even register on my server
Your mysql password. If you're using the same password from the time you got your hosting, have it changed to what you want and see if it works. But if you were able to have access to your phpmyadmin using the same username and password then there shouldn't be a problem. Make sure that your host requires "localhost" and not something like "mysql.hosting.com" - which is normally the case.


Re: Host mysql - saffierr - 15.04.2016

Thanks for the idea, it has been fixed.


Re: Host mysql - Eyce - 15.04.2016

Quote:
Originally Posted by saffierr
Посмотреть сообщение
Thanks for the idea, it has been fixed.
No problem. Could you at least tell me what the problem was? Thanks.