MySQL started, but not connected [Answered]

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

MySQL started, but not connected [Answered]

Postby jowelboy » 15. September 2012 22:35

Hi, Using XAMPP 1.8.0 My http://127.0.0.1 status has everything activated except MySQL.
The control panel states MySQL is running and the log file seems to indicate everything is ok.
However, when I click on the CD Collection in the PHP menu, I get this error:
Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. in E:\xampp\htdocs\xampp\cds.php on line 78
When I click on PHPAdmin I get '#2002 - php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found.
The server is not responding (or the local server's socket is not correctly configured). '

I HOPE it's something obvious!
Please can anyone help.

Image
jowelboy
 
Posts: 3
Joined: 15. September 2012 22:22
XAMPP Version: 5.6.3
Operating System: Windows 7 32bit

Re: MySQL started, but not connected

Postby JonB » 17. September 2012 18:18

In the Control Panel -

Does it show a 'Green Light' on MySQL?

what are the messages in the Control Panel dialogue box?

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL started, but not connected

Postby GaryG » 19. September 2012 12:08

I have the same exact problem


6:12:35 AM [main] Running with Administrator rights - good!
6:12:35 AM [main] XAMPP Installation Directory: "c:\xampp\"
6:12:35 AM [main] Initializing Modules
6:12:35 AM [apache] XAMPP Apache Service is already running on port 80
6:12:35 AM [apache] XAMPP Apache Service is already running on port 443
6:12:35 AM [mysql] XAMPP MySQL Service is already running on port 3306
6:12:35 AM [filezilla] XAMPP FileZilla FTP Server Service is already running on port 21
6:12:35 AM [filezilla] XAMPP FileZilla FTP Server Service is already running on port 14147
6:12:35 AM [main] Starting Check-Timer
6:12:35 AM [main] Control Panel Ready
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby GaryG » 19. September 2012 14:05

I searched this forum the entire night and tried a multitude of suggestions to no avail. I don't understand why the xampp can not find the phpMyAdmin and I can not installed a MySql database locally. This is my error I get.


Welcome to phpMyAdmin

Error

MySQL said: Documentation
#2002 - php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found.
The server is not responding (or the local server's socket is not correctly configured).
Connection for controluser as defined in your configuration failed.
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby GaryG » 20. September 2012 04:11

Im now able to get into phpMyAdmin but I still have this error in the CD and my Joomla can not connect to database

Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. in C:\xampp\htdocs\xampp\cds.php on line 78

Warning: mysql_connect(): php_network_getaddresses: getaddrinfo failed: The requested name is valid, but no data of the requested type was found. in C:\xampp\htdocs\xampp\cds.php on line 78
Could not connect to database!
Is MySQL running or did you change the password?



Under status it still shows MySQL deactivated?
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby JonB » 20. September 2012 22:24

what is the exact URL you are using?
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL started, but not connected

Postby GaryG » 20. September 2012 23:29

Hi JonB, first I want to thank you for the support my friend and enjoy being here on the forums.

Im using the 127.0.0.1 not localhost. For some reason it does not respond to localhost.

Oh I want to mention also, The XAMPP is working for me quite well so far. I am able to create a database and use it from the phpMyAdmin.
I installed JOOMLA and I already installed a chat forum. Also, installed JFusion to bridge and install a VBULLETIN that Im setting up as we speak. Im inquiring about the extension to integrate my clients OpenCart into the JOOMLA. I have a main client I am trying to build a "SUPER SITE" for.

The only thing is that part it still says MySQL deactivated. I thought it would make an impact on my work but so far it has not. Im assuming this is a false feedback from the tutorials I have read.

Look forward to your reply
JonB wrote:what is the exact URL you are using?
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby JonB » 21. September 2012 00:00

If that is so, I suspect the problem is a lack of a localhost IPv4 entry in the hosts file.

try adding '127.0.0.1 localhost' to your hosts file, that may clear the 'deactivated' link. I have not looked at the code but I would bet its querying 'localhost'.

This is due to the fact that in Vista and Win 7 IPv4 does not auto-resolve localhost, it only resolves via IPv6. (AFAIK)

As you have noted, that is purely a cosmetic issue at this point.

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL started, but not connected

Postby GaryG » 21. September 2012 01:08

Thank you JonB

Below I copy/pasted the host file information.


JonB wrote:If that is so, I suspect the problem is a lack of a localhost IPv4 entry in the hosts file.

try adding '127.0.0.1 localhost' to your hosts file, that may clear the 'deactivated' link. I have not looked at the code but I would bet its querying 'localhost'.

This is due to the fact that in Vista and Win 7 IPv4 does not auto-resolve localhost, it only resolves via IPv6. (AFAIK)

As you have noted, that is purely a cosmetic issue at this point.

8)
Last edited by GaryG on 21. September 2012 01:41, edited 1 time in total.
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby JonB » 21. September 2012 01:21

yeah - see that one:

Code: Select all
# 127.0.0.1 localhost


uncomment it. (remove the hash)

good luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL started, but not connected

Postby GaryG » 21. September 2012 01:39

hmmmmm I edited the file in notepad++ and removed the hash. Some reason when I save the file it comes as "Please check if this file is opened in another program" save failed. Control/Alt/Delete doesn't show me anything could be using that unless me being online is doing that?
JonB wrote:yeah - see that one:

Code: Select all
# 127.0.0.1 localhost


uncomment it. (remove the hash)

good luck
8)
GaryG
 
Posts: 6
Joined: 19. September 2012 11:57
XAMPP Version: 5.6.3
Operating System: windows

Re: MySQL started, but not connected

Postby JonB » 21. September 2012 01:47

it might be that Apache is using it.

You can definitely do it in Safe Mode.

Good Luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
XAMPP Version: 1.8.3-2
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: MySQL started, but not connected [Answered]

Postby jowelboy » 25. September 2012 10:55

Hi all,
Sorry for the lack of response. It's been a busy month.
Here's the rest of the Control Panel image:
Image

Despite all my efforts I'm still getting no where with SQL being activated!
Thanks all
jowelboy
 
Posts: 3
Joined: 15. September 2012 22:22
XAMPP Version: 5.6.3
Operating System: Windows 7 32bit

Re: MySQL started, but not connected [Answered]

Postby Altrea » 25. September 2012 11:23

Hi jowelboy,

have you uncomment (remove the #) the setting #bind-address="127.0.0.1" in your my.ini and restartet your MySQL?
If so the only thing i can guess are problems with security software like your Windows firewall.

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 6764
Joined: 17. August 2009 13:05
XAMPP Version: 5.5.19
Operating System: W7Ux64

Re: MySQL started, but not connected [Answered]

Postby scorpion369 » 08. October 2012 09:47

hi my name is sander,
and i tried all the tings on the forum in my host file it says
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost

127.0.0.1 localhost

in my cds file it says
&nbsp;<p>
<h1><?php print $TEXT['cds-head']; ?></h1>

<?php print $TEXT['cds-text1']; ?><p>
<?php print $TEXT['cds-text2']; ?><p>

<?php

// Copyright (C) 2002/2003 Kai Seidler, oswald@apachefriends.org
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


if(!mysql_connect("localhost","root","root"))
{
echo "<h2>".$TEXT['cds-error']."</h2>";
die();
}
mysql_select_db("cdcol");
?>

<h2><?php print $TEXT['cds-head1']; ?></h2>

<table border=0 cellpadding=0 cellspacing=0>
<tr bgcolor=#f87820>
<td><img src=img/blank.gif width=10 height=25></td>
<td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?php print $TEXT['cds-attrib1']; ?></b></td>
<td class=tabhead><img src=img/blank.gif width=200 height=6><br><b><?php print $TEXT['cds-attrib2']; ?></b></td>
<td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?php print $TEXT['cds-attrib3']; ?></b></td>
<td class=tabhead><img src=img/blank.gif width=50 height=6><br><b><?php print $TEXT['cds-attrib4']; ?></b></td>
<td><img src=img/blank.gif width=10 height=25></td>
</tr>


<?php
if(@$_REQUEST['interpret']!="")
{
$titel=mysql_real_escape_string($_REQUEST['titel']);
$interpret=mysql_real_escape_string($_REQUEST['interpret']);
$jahr=mysql_real_escape_string($_REQUEST['jahr']);
if($jahr=="")$jahr="NULL";
mysql_query("INSERT INTO cds (titel,interpret,jahr) VALUES('$titel','$interpret',$jahr);");
}

if(@$_REQUEST['action']=="del")
{
mysql_query("DELETE FROM cds WHERE id=".round($_REQUEST['id']));
}

$result=mysql_query("SELECT id,titel,interpret,jahr FROM cds ORDER BY interpret;");

$i=0;
while( $row=mysql_fetch_array($result) )
{
if($i>0)
{
echo "<tr valign=bottom>";
echo "<td bgcolor=#ffffff background='img/strichel.gif' colspan=6><img src=img/blank.gif width=1 height=1></td>";
echo "</tr>";
}
echo "<tr valign=center>";
echo "<td class=tabval><img src=img/blank.gif width=10 height=20></td>";
echo "<td class=tabval><b>".htmlspecialchars($row['interpret'])."</b></td>";
echo "<td class=tabval>".htmlspecialchars($row['titel'])."&nbsp;</td>";
echo "<td class=tabval>".htmlspecialchars($row['jahr'])."&nbsp;</td>";

echo "<td class=tabval><a onclick=\"return confirm('".$TEXT['cds-sure']."');\" href=cds.php?action=del&id=".$row['id']."><span class=red>[".$TEXT['cds-button1']."]</span></a></td>";
echo "<td class=tabval></td>";
echo "</tr>";
$i++;

}

echo "<tr valign=bottom>";
echo "<td bgcolor=#fb7922 colspan=6><img src=img/blank.gif width=1 height=8></td>";
echo "</tr>";


?>

</table>

<h2><?php print $TEXT['cds-head2']; ?></h2>

<form action=cds.php method=get>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><?php print $TEXT['cds-attrib1']; ?>:</td><td><input type=text size=30 name=interpret></td></tr>
<tr><td><?php print $TEXT['cds-attrib2']; ?>:</td><td> <input type=text size=30 name=titel></td></tr>
<tr><td><?php print $TEXT['cds-attrib3']; ?>:</td><td> <input type=text size=5 name=jahr></td></tr>
<tr><td></td><td><input type=submit border=0 value="<?php print $TEXT['cds-button2']; ?>"></td></tr>
</table>
</form>
<?php include("showcode.php"); ?>

</body>
</html>
my pass i maked in xampp is root

my php.ini
<?php
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';

/*
* End of servers configuration
*/

?>
i use 1.8.1 and it says mysql activated but same error on line 78
and i removed de hash for bind adress
scorpion369
 
Posts: 1
Joined: 08. October 2012 09:37
XAMPP Version: 5.6.3
Operating System: windows 7 64

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 51 guests