Lost connection to MySQL server at '...'

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Lost connection to MySQL server at '...'

Postby kamild1996 » 08. January 2012 19:52

Hi!
I'm hosting a MySQL database (with XAMPP of course). I put PHP script (which is using my database) in my site (not in my PC - I bought a WWW hosting). But when I'm trying to run this script, I get this:
Lost connection to MySQL server at 'reading initial communication packet', system error: 111
I have an internal IP but I'm using DynDNS. Address to script is: http://this-is-minecraft.xaa.pl/bany/banlist.php
How to fix it?
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 08. January 2012 22:42

XAMPP is working.

Have you asked your hosting service this question?

Perhaps there is a conflict with the version of MySQL used in XAMPP and the MySQL version used by your hosting service, especially if the hosting service version is older.

The readme_en.txt file in the xampp folder has all the component version numbers - check the version used by your hosting service against this list.

These Google search results may help.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 08. January 2012 22:57

Have you asked your hosting service this question?

No.

Perhaps there is a conflict with the version of MySQL used in XAMPP and the MySQL version used by your hosting service, especially if the hosting service version is older.

This is from phpMyAdmin - hosting:
Server: Localhost via UNIX socket
Server version: 5.1.56
Protocol version: 10
User: csrafael@localhost
MySQL charset: UTF-8 Unicode (utf8)


And this is from phpMyAdmin - XAMPP:
Server: localhost via TCP/IP
Server version: 5.5.16
Protocol version: 10
User: Mc-Wysypisko@localhost
MySQL charset: UTF-8 Unicode (utf8)


These Google search results may help.

I tried to resolve this problem by solutions found in Google. But no one of these works.
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 08. January 2012 23:01

Are you trying to connect to the database in XAMPP on your PC from the hosting service web site?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 08. January 2012 23:07

Are you trying to connect to the database in XAMPP on your PC from the hosting service web site?

Maybe I didn't understand this... but my script is connecting to a XAMPP-hosted database located in my PC.
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 08. January 2012 23:17

You will need to open phpMyAdmin and select the user for the database you are trying to connect with.

Then click on Edit privileges at the end of the line and change the Host setting from localhost to Any host (%) then click on Go.

No need to change anything else except you will need to allow access through any firewalls/routers you may be using - port 3306 is the MySQL port.

Close phpMyAdmin and try and connect to the database again from your remote server.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 08. January 2012 23:22

Then click on Edit privileges at the end of the line and change the Host setting from localhost to Any host (%) then click on Go.

I did it before creating this topic.

No need to change anything else except you will need to allow access through any firewalls/routers you may be using - port 3306 is the MySQL port.

Like above. I did it before creating this topic.
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 08. January 2012 23:27

kamild1996 wrote:
Then click on Edit privileges at the end of the line and change the Host setting from localhost to Any host (%) then click on Go.

I did it before creating this topic.

No need to change anything else except you will need to allow access through any firewalls/routers you may be using - port 3306 is the MySQL port.

Like above. I did it before creating this topic.
How are we supposed to know that unless you tell us? :shock:

Remember we can't see your screen or know what you are doing or what you have done unless you tell us.
viewtopic.php?f=16&t=48331
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 08. January 2012 23:36

Ok.

'Then click on Edit privileges at the end of the line and change the Host setting from localhost to Any host (%) then click on Go.'
I went to my XAMPP's phpMyAdmin (http://127.0.0.1/phpmyadmin/) and I choose "Privileges". Then I clicked "Edit privileges", in "Change Login Information / Copy User" changed "Host" to "Any host" and clicked "Go".

'No need to change anything else except you will need to allow access through any firewalls/routers you may be using - port 3306 is the MySQL port.'
I just unlocked port 3306 and 3307 in my router's control panel. Results:
Image

EDIT:
And I got screens when forwarding posts with my DynDNS and NoIP addresses.
http://imgur.com/UGYV7,6tdMq
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 09. January 2012 00:06

It seems you are not connecting to your database.

Check the mysql_error.log file in the \xampp\mysql\data folder.

Check the log files at your hosting service (is it cPanel).

Have you started MySQL in the XAMPP control Panel and is it running?
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 09. January 2012 00:13

Check the mysql_error.log file in the \xampp\mysql\data folder.

5 kb of text. Content in link below:
http://pastebin.com/4dvKAdSw

Check the log files at your hosting service (is it cPanel?).

Yes, this is cPanel.
Which logs? From cPanel? Or from phpMyAdmin?

Have you started MySQL in the XAMPP control Panel?

Of course. Apache and MySQL are running.

PS: When I put this script in "htdocs" folder in XAMPP and I go to "http://localhost/banlist.php", script is working. But instead of these settings in PHP file:
$server = "mc-wys.dyndns.biz";
$dbuser = "Mc-Wysypisko";
$dbpass = "goodPassword";
$dbname = "mcwys_banreport";

i set them to:
$server = "localhost";
$dbuser = "Mc-Wysypisko";
$dbpass = "goodPassword";
$dbname = "mcwys_banreport";

And it's working...
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 09. January 2012 00:23

mysql_error.log wrote:120108 23:51:18 [Warning] IP address '74.63.120.217' could not be resolved: Żądana nazwa jest prawidłowa i została znaleziona w bazie danych, ale dane, z którymi jest skojarzona, są niepoprawne.
:?:

In cPanel you can read the server's log files, try the error log first.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 09. January 2012 00:33

I found a translation for it.

"Żądana nazwa jest prawidłowa i została znaleziona w bazie danych, ale dane, z którymi jest skojarzona, są niepoprawne."

In English:
"The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for.".

There is no error logs in cPanel:
Image
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Re: Lost connection to MySQL server at '...'

Postby Sharley » 09. January 2012 00:53

$server = "mc-wys.dyndns.biz";
$dbuser = "Mc-Wysypisko";
$dbpass = "goodPassword";
$dbname = "mcwys_banreport";
Have tried Any host in the server field and/or your IP address?
Then try and access it from your hosting server web page again.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: Lost connection to MySQL server at '...'

Postby kamild1996 » 09. January 2012 00:58

Sharley wrote:
$server = "mc-wys.dyndns.biz";
$dbuser = "Mc-Wysypisko";
$dbpass = "goodPassword";
$dbname = "mcwys_banreport";
Have tried Any host in the server field and/or your IP address?
Then try and access it from your hosting server web page again.

Tried this. No effect.
I speak English very poorly, sorry!
kamild1996
 
Posts: 11
Joined: 08. January 2012 19:47
Operating System: Windows XP

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 131 guests