Connection to MySQL Database Failed please help in iweb and pwadmin
Connection to MySQL Database Failed please help in iweb and pwadmin
(iweb)
<%@page import="java.io.*"%>
<%
//-------------------------------------------------------------------------------------------------------------------------
//------------------------------- SETTINGS --------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// connection settings to the mysql pw database
String db_host = "192.168.1.101";
String db_port = "3306";
String db_user = "root";
String db_password = "mazinho";
String db_database = "pw";
String item_labels = "pwi";
String pw_auth_path = "/PWServer/authd/";
String pw_logs_path = "/PWServer/logs";
String pw_server_path = "/PWServer/";
boolean enable_character_list = true;
String pw_server_name = "YanYU";
String pw_server_description = "+ Info<br>+ 2 x 2.4 GHz, 2048 MB RAM, 100 MBit LAN";
%>
--------------------------------------------------------------
____________
(pwadmin)
<%@page import="java.io.*"%>
<%
//-------------------------------------------------------------------------------------------------------------------------
//------------------------------- SETTINGS --------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
// pwadmin access password as md5 encrypted string
// default password is wargames -> d32509439c6c165b930fd65cb2dfe50b
String iweb_password = "d32509439c6c165b930fd65cb2dfe50b";
// connection settings to the mysql pw database
String db_host = "localhost";
String db_port = "3306";
String db_user = "root";
String db_password = "mazinho";
String db_database = "pw";
// Type of your items database required for mapping id's to names
// Options are my or pwi
String item_labels = "pwi";
// Absolute path to your PW-Server main directory (startscript, stopscript, /gamed)
// requires a tailing slash
String pw_server_path = "/PWServer/";
// If you have hundreds of characters or heavy web acces through this site
// It is recommend to turn the realtime character list feature off (false)
// to prevent server from overload injected by character list generation
boolean enable_character_list = true;
String pw_server_name = "PERFECT WORLD WAR";
String pw_server_description = "+ Descricao do Servidor :<br>+ VBOX CPU + 1 x 2.5 GHz, 2048 MB RAM, 100 MBit LAN<br>+ Todas as Dungeons Abertas<br>+ Armas do Nirvana do Tideborn<br>+ Saliencias do mundo";
//-------------------------------------------------------------------------------------------------------------------------
//----------------------------- END SETTINGS ------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------
String pw_server_exp = "?";
String pw_server_sp = "?";
String pw_server_drop = "?";
String pw_server_coins = "?";
BufferedReader bfr = new BufferedReader(new FileReader(pw_server_path + "gamed/ptemplate.conf"));
String row;
while((row = bfr.readLine()) != null)
{
row = row.replaceAll("\\s", "");
if(row.indexOf("exp_bonus=") != -1)
{
int pos = row.length();
if(row.indexOf("#") != -1)
{
pos = row.indexOf("#");
}
pw_server_exp = row.substring(10, pos);
}
if(row.indexOf("sp_bonus=") != -1)
{
int pos = row.length();
if(row.indexOf("#") != -1)
{
pos = row.indexOf("#");
}
pw_server_sp = row.substring(9, pos);
}
if(row.indexOf("drop_bonus=") != -1)
{
int pos = row.length();
if(row.indexOf("#") != -1)
{
pos = row.indexOf("#");
}
pw_server_drop = row.substring(11, pos);
}
if(row.indexOf("money_bonus=") != -1)
{
int pos = row.length();
if(row.indexOf("#") != -1)
{
pos = row.indexOf("#");
}
pw_server_coins = row.substring(12, pos);
}
}
bfr.close();
if(request.getSession().getAttribute("items") == null)
{
String[] items = new String[60001];
try
{
bfr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(request.getRealPath("/include/items") + "/default.dat")), "UTF8"));
if(item_labels.compareTo("my") == 0)
{
bfr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(request.getRealPath("/include/items") + "/my.dat")), "UTF8"));
}
if(item_labels.compareTo("pwi") == 0)
{
bfr = new BufferedReader(new InputStreamReader(new FileInputStream(new File(request.getRealPath("/include/items") + "/pwi.dat")), "UTF8"));
}
int count = 0;
while((row = bfr.readLine()) != null && count < 60001)
{
items[count] = row;
count++;
}
bfr.close();
}
catch(Exception e)
{
}
request.getSession().setAttribute("items", items);
}
%>
___________________________________________________________________________
Change String db_host = "192.168.1.101"; to String db_host = "localhost";
Last edited by Mazinho Oo; 27-10-13 at 02:36 AM.
I'm experiencing similar problems but I can read from the database I am just unable to write new entries, I have checked the permissions in phpmyadmin and checked file permissions in the file system. Any Ideas?
ive had the same issue.. it took me days to figure it out... search the forum for a new database.. its called dbo.sql delete the database in phpmyadmin and replace using the new one... that will allow you to write new entries... most the 1.4.6 ive tried has had bad databases and authds and gdelievery... but id recommend using the console to start the server before using pwadmin as pwadmin showed everything working fine but console showed the errors.