another Mysql server Connect Failure
#1

Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: NO) in /home/u829025349/public_html/ucp/config.php on line 3 I can't connect to the server!


Код:
$connect = mysql_connect("localhost", "root", "") or die("I can't connect to the server!");
u may wonder why my pass is empty, and thats cuz i'm using Xampp and it dosen't Have a pass in default ... any solution?
Reply
#2

you didn't mention the database?
Код:
mysql_connect(const host[], const user[], const database[], const password[])
put the database's name after "root"
Reply
#3

ALSO, If you don't want to get some errors. It's suggestable to change the IP to 127.0.0.1 instead of localhost. The socks can be fucked if not.
Reply
#4

Quote:
Originally Posted by SaintMikey
Посмотреть сообщение
ALSO, If you don't want to get some errors. It's suggestable to change the IP to 127.0.0.1 instead of localhost. The socks can be fucked if not.
When you login to phpmyadmin with XAMPP the URL is:
So better use localhost.
Reply
#5

thx for your answer,
i hope you mean like this
Quote:

$connect =(mysql_connect(const host[localhost], const user[root], const password[])

((Database queries are defined on other line))
If you meant it to be like that .. it didn't work
if possible i give you my skype to fix it together ?
Reply
#6

Quote:
Originally Posted by SWAT4
Посмотреть сообщение
thx for your answer,
i hope you mean like this

((Database queries are defined on other line))
If you meant it to be like that .. it didn't work
if possible i give you my skype to fix it together ?
Look,
at the top of your script do this:
Код:
#define host "localhost"
#define user "root"
#define database "samp"
#define pass ""
then go to OnPlayerConnect and put this:
Код:
$connect = mysql_connect(host,user,database,pass);
Reply
#7

error turned into this when i used the format above
Код:
Parse error: syntax error, unexpected T_CONST, expecting ')' in /home/u829025349/public_html/ucp/config.php on line 3
//Line 2+3
Код:
$connect =(mysql_connect(const host[localhost], const user[root], const password[])) or die("I can't connect to the server!");
    mysql_select_db("samp") or die ("I can't find the database!");
Reply
#8

Quote:
Originally Posted by Terrorizt
Посмотреть сообщение
Look,
at the top of your script do this:
Код:
#define host "localhost"
#define user "root"
#define database "samp"
#define pass ""
then go to OnPlayerConnect and put this:
Код:
$connect = mysql_connect(host,user,database,pass);
Did you do this?
Reply
#9

ahh, Bro, that solution u said is for scripting pawno but my problem is For PHP and ucp sorry if i didn't clear it well :/
Reply
#10

any suggestions?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)