Jump to content

Help Pls Error On Website


Recommended Posts

edit now new error i have add mysql pass now i take 

Warning: mysql_connect() [function.mysql-connect]: Host 'web.fr1.hostchefs.net' is not allowed to connect to this MySQL server in /home/lnukecom/public_html/index.php on line 206

Host 'web.fr1.hostchefs.net' is not allowed to connect to this MySQL server

<?php $server_ip = "ip from dedicate";
           $mysql_user = "root";
           $mysql_pass = "pass from mysql";
           $database = "l2jdb";

           $connect = mysql_connect("$server_ip", "$mysql_user", "$mysql_pass") or die(mysql_error());
           $db_select = mysql_select_db("$database", $connect) or die(mysql_error());
           $query = mysql_query("SELECT online FROM characters WHERE online=1") or die(mysql_error()) ;

           $online_chars = mysql_num_rows($query);

          echo 'Players Online:'.$online_chars;

mysql_close($connect);
?>

Edited by L2BlackDays
Link to comment
Share on other sites

/lnukecom/public_html/index.php on line 191

 

Check this.

 

Also, you need to insert in the $mysql_user = username $mysql_pass = db account pass 

Link to comment
Share on other sites

/lnukecom/public_html/index.php on line 191

 

Check this.

 

Also, you need to insert in the $mysql_user = username $mysql_pass = db account pass 

but on database i dont use password.

Edited by L2BlackDays
Link to comment
Share on other sites

edit now new error i have add mysql pass now i take 

Warning: mysql_connect() [function.mysql-connect]: Host 'web.fr1.hostchefs.net' is not allowed to connect to this MySQL server in /home/lnukecom/public_html/index.php on line 206

Host 'web.fr1.hostchefs.net' is not allowed to connect to this MySQL server

Link to comment
Share on other sites

  • 1 month later...

If you are connecting to db from an external server you should create an other user to be more safe. Run this queries, the first one allows you to connect with an external user:

grant all privileges on l2jdb.* to myuser@'%' identified by 'mypasswd';
grant all privileges on l2jdb.* to myuser@localhost identified by 'mypasswd';

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock