Page 1 of 1

Can't connect to MySQL

PostPosted: 17. March 2014 09:14
by mindful123
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)


Re: Can't connect to MySQL

PostPosted: 17. March 2014 11:05
by JJ_Tagy
Check that your windows hosts file has an entry for localhost to

Re: Can't connect to MySQL

PostPosted: 17. March 2014 19:00
by mindful123
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:
# # source server
# # x client host

# localhost name resolution is handled within DNS itself.
# localhost
# ::1 localhost
# Start of Entries made by A1C V1x0r's cs5 Activator localhost
# End of Entries made by A1C V1x0r's CS5 Activator

Re: Can't connect to MySQL

PostPosted: 17. March 2014 19:10
by mindful123
Guess what?

I changed localhost to 127.0.01 localhost that resolved the issue.

I appreciated you for all your help.
Thank you

Re: Can't connect to MySQL

PostPosted: 18. March 2014 09:29
by mindful123
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.