MySQL Databse.
#1

Hello there, am getting these errors when am starting my server in the host.
I have created MySQL database but i don't know why am getting these errors.

Код:
[13:09:01] [MySQL] Error (0): Function: mysql_query called when not connected to any database. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
[13:09:01] [MySQL] Error (0): Failed to connect. Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
My code

Код:
#define db 				 "my database username"
#define host 					"localhost"
#define user 					"my database username"
#define pass 					"my database password"
I think my code is fine, what's wrong then?
Reply
#2

Don't tell me you didn't actually change "my database username", "my database password" and all that shit..?
Reply
#3

DId you use this function (mysql_connect) under ongamemodeinit or onfilterscriptinit
Otherwise your server won't get connected to the MYSQL server or then the queries won't be performed in database if not connected.
Reply
#4

Quote:
Originally Posted by FlawPaw
Посмотреть сообщение
Don't tell me you didn't actually change "my database username", "my database password" and all that shit..?
Dude, do i have to say my database info in here? Please.
Reply
#5

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
DId you use this function (mysql_connect) under ongamemodeinit or onfilterscriptinit
Otherwise your server won't get connected to the MYSQL server or then the queries won't be performed in database if not connected.
Yep, but it doesn't works.
Reply
#6

how's your mysql_connect code looks?
which program you use to connect to mysql database?
Reply
#7

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
how's your mysql_connect code looks?
which program you use to connect to mysql database?
My mysql_connect code
Код:
 mysql_connect( host, user, pass, db, mysql, 1 );
    #endif
Am using phpmyadmin to connect to my mysql database.
Reply
#8

Quote:
Originally Posted by TheSnaKe
Посмотреть сообщение
Dude, do i have to say my database info in here? Please.
Well, it's on localhost. Nothing should happen..
Reply
#9

If you use iptables, make sure to add an exception for the lo interface to the top of the list.
Reply
#10

Still not working
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)