Hey guys..i have a MySQL Error.I have DELETE my.ini & MySQL Admin is GREEN LIGHT.I also have the some problem when im trying to make site & forum.Im using WAMP.Here the pic:
SITE PROB:
MySQL Admin GREEN LIGHT:
Although my MySQL cannot connect,but i still can open the database:
If I remember correctly, You wouldn't be able to open the DB if MySQL was not connecting, And Looks to me that its clearly connecting. Now, on the site problem, I don't use wamp so I can't help you there. Sorry x.X
Also Posting your index.php code may help getting your issue resolved.
Now from the picture i saw before you edited it was that the error was on line 3 so it will be something wrong along this line,
Quote:
$p = $_GET['id'];
try changing this line
Quote:
$p = $_GET['id'];
to
Quote:
$p = $_POST['id'];
and see if that works.
That's all I can really help you with atm. I hope someone can be smarter than me and resolve your problem if mine does not fix it.
Now from the picture i saw before you edited it was that the error was on line 3 so it will be something wrong along this line, That's all I can really help you with atm. I hope someone can be smarter than me and resolve your problem.
@mysql_connect(host, user, pass) or die('<h1>Unable to connect to database server.</h1>');
@mysql_select_db(mydbdata) or die('<h1>Unable to connect to database server.</h1>');
to
PHP Code:
@mysql_connect(host, user, pass) or die('<h1>Unable to connect to database server.</h1>' . mysql_error());
@mysql_select_db(mydbdata) or die('<h1>Unable to connect to database server.</h1>' . mysql_error());
This will give you the mysql error code and tell you where it's failing. At the same time, undo any changes xTwiztedKidx suggested that you have made.
EDIT: Since this really isn't a EO PServer question, but a general PHP/MySQL question, this really should have been posted in the thread where you got your site files from. That way we wouldn't have to ask you to put your index.php in there, the creator of the site could also chime in if he's watching his threads, etc.
define('host', 'localhost'); // Your database host
define('user', 'root'); // Your database username
define('pass', 'test'); // Your database password
define('mydbdata', 'my'); // Your database name my
define('mydbacc', 'account'); // Your database name account
define('serveraddress', 'hamanchi ip'); // Your Server address
define('serverport', '5816'); // Your serverport
define('mydb', 'my'); // Your my database
define('servername', 'BlackThunder Online'); // Your Server Name
define('poweredby', 'Powered By *****************'); // Dont Delete!
define('imgdir', 'http://hamanchi ip/'); // Your Image dir
// conect to database
@mysql_connect($myhost, $myuser, $mypass) or die('<h1>Unable to connect to database server.</h1>');
@mysql_select_db(@mydb) or die('<h1>Unable to connect to database server.</h1>');
?>
I automaticlly noticed and i didnt say it a bit ago, This line,
Quote:
define('serverport', '3306'); // Your serverport
is the wrong port. 3306 is the mysql port.
This is the correct port for the server not mysql.
Quote:
define('serverport', '5816'); // Your serverport
And, I think this line(s) here
Quote:
@mysql_connect(host, user, pass) or die('<h1>Unable to connect to database server.</h1>');
@mysql_select_db(mydbdata) or die('<h1>Unable to connect to database server.</h1>');
Should be
Quote:
@mysql_connect($myhost, $myuser, $mypass) or die('<h1>Unable to connect to database server.</h1>');
@mysql_select_db(@mydb) or die('<h1>Unable to connect to database server.</h1>');
But try my config (ive edited it so it would be easier for you)and just edit the hamanchi IP spot and try it.
This is pretty much the config that i use, and it does work so i thought maybe that would help.
If it doesnt, Sorry, I tried to help.
And King_Arthur
The site files, by looking at the config, is from the EO section. Just saying.
<?php
require_once './inc/class.captcha.php';
// Configurations
$myhost="localhost";
$mypass="test"; //your server login password
$myuser="root"; //your server login username
$mydbacc="account"; //your server account database
$mydbdata="my"; //your server my database name
$serveraddress="5.66.**,***"; //your server ip
$serverport=3306; //your server connection port
$mydb="my"; //your server my database
$servername = "BlackThunder Online"; //Put your servername here.
$link = "http://5.66.**.***"; //Put your website link here
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
as i stated above. 3306 CANNOT be used. Its the MySQL Port. Change it to 5816 [Which is the Server Port] and try again.
this below is the config u just gave us, the red is the error or stuff u forgot to add.
Quote:
<?php
require_once './inc/class.captcha.php';
// Configurations
$myhost="localhost";
$mypass="test"; //your server login password
$myuser="root"; //your server login username
$mydbacc="account"; //your server account database
$mydbdata="my"; //your server my database name
$serveraddress="5.66.**,***"; //your server ip
$serverport="5816"; //your server connection port the " are needed also.
$mydb="my"; //your server my database
$servername = "BlackThunder Online"; //Put your servername here.
$link = "http://5.66.**.***"; //Put your website link here
// Dont Edit after this
mysql_connect($myhost,$myuser,$mypass);
mysql_select_db($mydb);
?>
San-Goku: You now have a different config.php than before. Which one is the real one?
Also, instead of using 'localhost' just use '127.0.0.1' and see if that helps if you aren't mix-matching different php files.
xTwiztedKidx:
PHP Code:
define('host', 'localhost'); // Your database host
define('user', 'root'); // Your database username
define('pass', 'test'); // Your database password
@mysql_connect($myhost, $myuser, $mypass) or die('<h1>Unable to connect to database server.</h1>');
host != $myhost
EDIT: Any problems with the server port should be inconsequential at the moment anyway since you can't even see the site yet. You can wait to fix those as your script is failing to connect to mysql.
Yes, King_Arthur I do agree, Its even different from the one I suggested. I also noticed he is using Port 3306 which is MySql, And you need to use 5816. Which is the server port. And he don't have the quotations around the port number which will also throw an error.
The reason the site is failing to connect can be because of the Port. But, I could be wrong. It can also be other reasons beyond that.
EDIT: Nevermind I believe you are right on the port thing King_Arthur. Sorry for the confusion. Try the localhost trick that King_Arthur stated above.
Mysql error & Keine Connection von aussen (belohnung) 01/30/2011 - WoW Private Server - 4 Replies Hi,
seit 2 tagen versuche ich die mysql richtig zum laufen zu bekommen,
mein server existiert ja man kann auch schon drauf spielen,
jedoch kann ich keine regi page online stellen auf einem webspace es kommt immer keine verbindung zur datenbank.
oder wenn ich ausserhalb via navicat connecten will cant get hostname for ur adress.
Wie kann ich die mysql so einstellen das sie von ausserhalb erreich bar ist habe schon alle dinge versucht benutzer@% etc.
wer kann mir bei diesem problem...
[ERROR] Mysql can't connect to local Mysql server through socket 11/06/2010 - Metin2 Private Server - 5 Replies I just recently tried to configure a DNS server for MT2.. It came up with this error
ERROR: 2002 (HY000): Can't connect to local Mysql server through socket '/tmp/mysql.sock' (2)
Do I need to do a fresh installation of FBSD?
:S
Thanks.
ERROR: Connection failed. Host 'Mcncc.com' is blocked because of many connection erro 04/10/2010 - Metin2 Private Server - 8 Replies Hab ein Problem mit meinem DynDns Server nach einiger Zeit kommt bei der DB und Regi immer olgendes "ERROR: Connection failed. Host 'Mcncc.com' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" kann mir jemand sagen woran das liegt?
Error MySQL Connection and New Database 11/24/2008 - CO2 Private Server - 8 Replies My first problem: I'm trying to remake another server using LOTF this time, but now when I try to open up the localhost connection in MySQL I get this error: 2003 - Can't connect to MySQL server on 'localhost' (10016). I remember this error happened to me before as well, but I forget what exactly I did to fix it because it was working later on. If I can't open the connection then I can't make a new database.
My second problem: When I go here "http://localhost/phpmyadmin"
The page cannot be...