PDA

View Full Version : Access denied MYSQL ?


Crystallize
31/07/2017, 10:36 AM
mysql_log
[12:21:12] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'hidden'@'IPHIDDEN' (using password: YES)
[12:21:13] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'hidden'@'IPHIDDEN' (using password: YES)


this happens on my localhost when I want to login lol
I have 3 connections done to mysql server.
From FS
From GM
From my UCP (website)

Would that be an issue? my main server isn't affected only localhost.

I unload FS> I can login
I load FS> I can't login
They use different tables.

Xeon™
31/07/2017, 10:38 AM
mysql_log
[12:21:12] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'hidden'@'IPHIDDEN' (using password: YES)
[12:21:13] [ERROR] CMySQLConnection::Connect - (error #1045) Access denied for user 'hidden'@'IPHIDDEN' (using password: YES)


this happens on my localhost when I want to login lol
I have 3 connections done to mysql server.
From FS
From GM
From my UCP (website)

Would that be an issue? my main server isn't affected only localhost.

Disable firewall, and check if the connection is allowed to localhost (mysql server allow more than 1 connection), check the user login's

Crystallize
31/07/2017, 10:40 AM
Disable firewall, and check if the connection is allowed to localhost (mysql server allow more than 1 connection), check the user login's

I unload FS I can login.
I load FS I can't login.
What the issue could be? The FS is not affiliated with main gm it uses different tables&db

Xeon™
31/07/2017, 10:42 AM
I unload FS I can login.
I load FS I can't login.
What the issue could be? The FS is not affiliated with main gm it uses different tables only same database.

it might be the FS and gamemode use same handle, Mysql Handle is an Id (number) not something special
so i guess you need to set it manualy (spell ;-;)

like that

OnGamemode:

new MySQL:Database = 0;

OnFilterScript:

new MySQL:Handle = 1;

OnAnythingElse

new MySQL:Handle = (int anything else ^)

Crystallize
31/07/2017, 10:50 AM
my onfsinit

my mysql variable (i set it as you said or maybe I got it wrong?
new mysql = 1;

Xeon™
31/07/2017, 10:56 AM
my onfsinit
mysql=mysql_connect(--); //Connecting to mysql database

my mysql variable (i set it as you said or maybe I got it wrong?
new mysql = 1;

what mysql plugin you are using?

if you use R40+ you should put MySQL: tag to be

new MySQL:mysql = 1;

Logic_
31/07/2017, 10:57 AM
Please hide your credentials + (Above poster) He's using R39 and no need to quote his every post.

Crystallize
31/07/2017, 10:58 AM
Please hide your credentials + (Above poster) He's using R39 and no need to quote his every post.

I'm a fucking idiot but I will delete it anyways its a test db wont be useful in next 5 mins.
And yes im using r39 if im not mistaken lol

Logic_
31/07/2017, 11:01 AM
The main question arises why are you using the FS, you can integrate it in your script.

Xeon™
31/07/2017, 11:01 AM
Please hide your credentials + (Above poster) He's using R39 and no need to quote his every post.

no, he is using R40 based on mysql_connect that he used
password and database parameters swapped in mysql_connect:
Code:
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_DATABASE, MYSQL_PASSWORD);
becomes
Code:
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE);

so you should put MySQL: tag on the variable @Crystallize

EDIT: i did saw the Database in last of params on mysql_connect if im not mistaken

aoky
31/07/2017, 11:03 AM
Just integrate it into your script as Logic said, filterscripts aren't a good idea in my honest opinion.

Crystallize
31/07/2017, 11:04 AM
no, he is using R40 based on mysql_connect that he used


so you should put MySQL: tag on the variable @Crystallize

EDIT: i did saw the Database in last of params on mysql_connect if im not mistaken


What do you mean on the variable so what do you think I should use on mysql connect? I still dont get it
And I dont want to integrate it , it will create unnecessary errors and will be time wasting.

Xeon™
31/07/2017, 11:07 AM
// var

new MySQL:mysql = 1;

mysql = mysql_connect(....)

for both gm and fs

set gm = 0
and fs = 1

Crystallize
31/07/2017, 11:07 AM
I think I fixed it.
jalt recommended me to load the fs ongamemodeinit and it works fine.


SendRconCommand("loadfs bllblb");

thanks everyone tho.

skuller12
31/07/2017, 11:08 AM
@Crystallize show me your mysql_password

Xeon™
31/07/2017, 11:12 AM
I think I fixed it.
jalt recommended me to load the fs ongamemodeinit and it works fine.


SendRconCommand("loadfs bllblb");

thanks everyone tho.

that will not work fine.

its works because of gamemode take first connection. when gamemode connect, the filterscript will stay on connection pending (because of same handle) and if you use filterscript on same handle of gamemode there will be some errors around, and this can be cutting connection bettwen gamemode and server.

Crystallize
31/07/2017, 11:21 AM
@Crystallize show me your mysql_password

mysql_password "skullergaming" enjoy.

xeonmaster I still don't get it what do i have to do
can you write me a basic fs on how i tshould be? like new mysql; etc?

jlalt
31/07/2017, 11:21 AM
that will not work fine.

its works because of gamemode take first connection. when gamemode connect, the filterscript will stay on connection pending (because of same handle) and if you use filterscript on same handle of gamemode there will be some errors around, and this can be cutting connection bettwen gamemode and server.

http://wiki.sa-mp.com/wiki/MySQL#mysql_connect

Return Values:
Connection handle or MYSQL_INVALID_HANDLE on error.

mysql_connect function returns handle id, not you. so you can not assign it manually!

Xeon™
31/07/2017, 11:23 AM
http://wiki.sa-mp.com/wiki/MySQL#mysql_connect



mysql_connect function returns handle id, not you. so you can not assign it manually!

oh, sorry! i did mixed it up with SQLite and the old mysql plugin. appologize's

Vince
31/07/2017, 03:29 PM
The fact that you've censored the hostname makes me think you're connecting through the WAN IP. If the MySQL server is on the same local network then you should use the internal hostname or IP address. Going through the WAN IP is like knocking on your own front door every time you want to get something out of your fridge.