Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

stuck in greenhope's www folder L2J 

Status
Not open for further replies.
Newbie Spellweaver
Joined
Apr 29, 2005
Messages
21
Reaction score
0
its been a while i try to ake this work but i just can't!
here is my www/main/inc/config.php file:

---------------------------------------------------------------------
//Database
//////////
$dbhost="localhost/127.0.0.1"; //Host/IP from the MySQL Database
$dbname="l2jdb"; //Name of Database (in many times it is 'l2jdb')
$dbuser="root"; //Username to the MySQL Database
$dbpass=""; //Passwort to the MySQL Database

$config['config_script_name']="Private Server"; //Here you can wrote you name from the Homepage / Clan or something.
//It will be displayed on the Top

$config['config_map_quality']="middle"; //Quality of the Map and size
//"low" = Low quality and size (this can reduce the traffic of the server)
//"middle" = Middle quality and size (this looks good on 1280x1024 resolution)
//"high" = High quality and size (this is a detailed map but more traffic)
//
//Notice: Whole-Map is always "low" quality

$config['server_path']="C:/server/l2j/data/announcements.txt"; //Full path to the announcements.txt.
//example:
//Windows = C:/server/l2j-server/data/announcements.txt
//Linux = /usr/server/l2j-server/data/announcements.txt




///////////////////////////////////////////////////////////////////////////////////////////////////
//Dont edit behind this line///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////

$verbindung=MYSQL_CONNECT($dbhost,$dbuser,$dbpass) or die ("Datenbankserver nicht erreichbar");
MYSQL_SELECT_DB($dbname) or die ("Datenbank nicht vorhanden");

$get_config_data="SELECT online FROM characters WHERE online>0";
$config_data=MYSQL_QUERY($get_config_data);
$config['num_online']=mysql_num_rows($config_data);

//$handle = fopen("http://www.whatismyip.com/", "r");
//$contents = '';
//while (!feof($handle)){$contents .= fread($handle, 8192);**
//fclose($handle);
//preg_match( "/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/", $contents, $matches );
//$config['server_ip']=$matches[0];
$config['127.0.0.1/localhost']=$_SERVER["localhost/127.0.0.1"];

error_reporting(0);
$IP = array(
"login_server" => "193.92.230.78:2106",
"game_server" => "193.92.230.78:7777",
);
while(list($ServerName,$Host)=each($IP))
{
list($IPAddress,$Port)=explode(":",$Host);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5))
{
$config[$ServerName]="<font color=\"#00ff00\">Online</font>";
fclose($fp);
**else{
$config[$ServerName]="<font color=\"#ff0000\">Offline</font>";
**
**

mysql_close($verbindung);
?>
=======================================================

and here is the error i get:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/www/jimtre8.coconia.net/www/main/inc/config.php on line 45
Datenbankserver nicht erreichbar

HELP!!!! i tried every combimation!:toilet_cl
 
Newbie Spellweaver
Joined
Jun 30, 2004
Messages
39
Reaction score
0
$dbuser="root"; //Username to the MySQL Database
$dbpass=""; //Passwort to the MySQL Database

db pass is blank.

try putting in root

$dbpass="root"; //Passwort to the MySQL Database
 
Upvote 0
Newbie Spellweaver
Joined
Sep 19, 2005
Messages
7
Reaction score
0
and put in there the name of the DB, if named other than l2jdb.
and as Avex said check your password for root ... i thought u put none there cos privacy. if it's blank in the file too, then write instead ur mysql root password.
As for the error i see it gives at line 45 it sound like Database not available/cannot connect to database. so check for mysql to be started or ... installed ? :)
 
Upvote 0
Newbie Spellweaver
Joined
Apr 29, 2005
Messages
21
Reaction score
0
mysql server is running, i changed the pass to blank cause i haven't any in navicat, do i have to put the whole www folder somewhere else so the internet can see it apart from the webserver of course?
 
Upvote 0
Newbie Spellweaver
Joined
Sep 19, 2005
Messages
7
Reaction score
0
as i know , the www is fine where it is cos it knows to connect mysql, it just doesnt find the DB. and the line with "$dbhost="localhost/127.0.0.1"; //Host/IP from the MySQL Database" is there writen in the config file "localhost/127.0.0.1" ? cos if it so then u got to delete either localhost or 127.0.0.1, and the "/" too of course.
Give us feedback.
 
Upvote 0
Newbie Spellweaver
Joined
Apr 29, 2005
Messages
21
Reaction score
0
no no no i just put both to say that i tried them both but nothing worked!
whether i put localhost or 127.0.0.1
perhaps if i reinstall my sql?
and what is this socket?
: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 
Upvote 0
Newbie Spellweaver
Joined
Apr 29, 2005
Messages
21
Reaction score
0
ok i solved my problem, i had installed easyphp in my system which caused all the problem, in his guide greehope say u should remove all apache/easyphp/mysql before starting the server - i didn't!
hope i helped someone with the same problem!
 
Upvote 0
Status
Not open for further replies.
Back
Top