Can't connect to MySQL

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

Can't connect to MySQL

Postby mindful123 » 17. March 2014 09:14

I just downloaded XAMPP xampp-win32-1.8.2-4-VC9-installer(1). Apache and MySQL are running using port 80,443 and 3306.

when I enter MySQL -u root at the command prompt it does not connect. I get following error message. I need your assistance to resolve this. Thanks

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\kabir> cd \

C:\>cd C:\xampp\mysql\bin

C:\xampp\mysql\bin>mysql -u root
ERROR 2005 (HY000): Unknown MySQL server host 'localhost' (2)

C:\xampp\mysql\bin>
mindful123
 
Posts: 5
Joined: 17. March 2014 08:58
Operating System: windows 7

Re: Can't connect to MySQL

Postby JJ_Tagy » 17. March 2014 11:05

Check that your windows hosts file has an entry for localhost to 127.0.0.1
JJ_Tagy
 
Posts: 678
Joined: 30. January 2012 13:44
Operating System: Windows 10 Pro x64

Re: Can't connect to MySQL

Postby mindful123 » 17. March 2014 19:00

Thank you for your reply,
I opened a host file from this location windows>system32>drivers>etc>host and I found following. I have not changed or saved anything yet. I don't know if I need to change anything.

# 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 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
# Start of Entries made by A1C V1x0r's cs5 Activator
0.0.0.0 localhost
127.0.0.1 activate.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 ereg.adobe.com
127.0.0.1 activate.wip3.adobe.com
127.0.0.1 wip3.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 activate-sjc0.adobe.com
# End of Entries made by A1C V1x0r's CS5 Activator
mindful123
 
Posts: 5
Joined: 17. March 2014 08:58
Operating System: windows 7

Re: Can't connect to MySQL

Postby mindful123 » 17. March 2014 19:10

Guess what?

I changed 0.0.0.0 localhost to 127.0.01 localhost that resolved the issue.

I appreciated you for all your help.
Thank you
mindful123
 
Posts: 5
Joined: 17. March 2014 08:58
Operating System: windows 7

Re: Can't connect to MySQL

Postby mindful123 » 18. March 2014 09:29

I'm trying to verify access to Retail application which is stored in XAMPP/htdocs.

I can verify user name as "root" and password empty ( default setting). however, using root and blank password are not working because it does not create session.

Is there way I can change user name/ password on MySQL or Retail from localhost/phpmyadmin/#PMAURL?


<username xsi:type="xsd:string">root</username>
<password xsi:type="xsd:string"></password>
Thank you.
mindful123
 
Posts: 5
Joined: 17. March 2014 08:58
Operating System: windows 7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 46 guests