Chucky™ Posted February 20, 2014 Posted February 20, 2014 (edited) 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 February 21, 2014 by L2BlackDays
Aphelion Posted February 21, 2014 Posted February 21, 2014 /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
Chucky™ Posted February 21, 2014 Author Posted February 21, 2014 (edited) /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 February 21, 2014 by L2BlackDays
Chucky™ Posted February 21, 2014 Author Posted February 21, 2014 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
Lavos Posted March 27, 2014 Posted March 27, 2014 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';
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now