Page 1 of 1

Unable to Connect to MySQL Database

PostPosted: 29. July 2012 14:04
by allabakash
I've installed the latest version of xampp and started the xampp console and tried to run phpadmin module. It was unable to connect using the root and default password (which is blank). I tried to connect to mysql using the HeidiSQL too. Still it was not connecting using the username root and no password. Seems the default password of root is set to something in the latest versions of xampp(may be I'm wrong). Can someone help me with this?

Re: Unable to Connect to MySQL Database

PostPosted: 29. July 2012 21:09
by JonB
A. Does MySQL show as started in the Conrol Panel?

B. The exact error codes, and the contents of the C:\xampp\mysql\data\mysql_error.log would be useful.

C. XAMMP (and all other direct MySQL installers) ship with 'root' password set to null (the empty set). However, there are configuration options for some MySQL tools that will not work at all with a null password.

D. In the \xampp\mysql folder there is a eponymous batch file that resets the root and pma passwords to a null. Its called - resetroot.bat

Good Luck
8)

Re: Unable to Connect to MySQL Database

PostPosted: 30. July 2012 04:31
by allabakash
MySQL is showing as started.
The message that I'm getting in HeidiSQL is "SQL Error (1045): Access denied for user 'root'@'localhost' (using password : NO)"

The following is the dump from the log
_____________________________________________________________________________________________

120728 17:10:05 [Note] Plugin 'FEDERATED' is disabled.
120728 17:10:05 InnoDB: The InnoDB memory heap is disabled
120728 17:10:05 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 17:10:05 InnoDB: Compressed tables use zlib 1.2.3
120728 17:10:05 InnoDB: Initializing buffer pool, size = 16.0M
120728 17:10:05 InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file \xampp\mysql\data\ibdata1 did not exist:
InnoDB: a new database to be created!
120728 17:10:05 InnoDB: Setting file \xampp\mysql\data\ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
120728 17:10:06 InnoDB: Log file \xampp\mysql\data\ib_logfile0 did not exist: new to be created
InnoDB: Setting log file \xampp\mysql\data\ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
120728 17:10:06 InnoDB: Log file \xampp\mysql\data\ib_logfile1 did not exist: new to be created
InnoDB: Setting log file \xampp\mysql\data\ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: 127 rollback segment(s) active.
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
120728 17:10:07 InnoDB: Waiting for the background threads to start
120728 17:10:08 InnoDB: 1.1.8 started; log sequence number 0
120728 17:10:08 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120728 17:10:08 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120728 17:10:08 [Note] Server socket created on IP: '0.0.0.0'.
120728 17:10:08 [ERROR] Can't start server: Bind on TCP/IP port: No such file or directory
120728 17:10:08 [ERROR] Do you already have another mysqld server running on port: 3306 ?
120728 17:10:08 [ERROR] Aborting

120728 17:10:08 InnoDB: Starting shutdown...
120728 17:10:08 InnoDB: Shutdown completed; log sequence number 1595675
120728 17:10:08 [Note] mysql\bin\mysqld: Shutdown complete

120728 17:10:31 [Note] Plugin 'FEDERATED' is disabled.
120728 17:10:31 InnoDB: The InnoDB memory heap is disabled
120728 17:10:31 InnoDB: Mutexes and rw_locks use Windows interlocked functions
120728 17:10:31 InnoDB: Compressed tables use zlib 1.2.3
120728 17:10:31 InnoDB: Initializing buffer pool, size = 16.0M
120728 17:10:31 InnoDB: Completed initialization of buffer pool
120728 17:10:31 InnoDB: highest supported file format is Barracuda.
120728 17:10:31 InnoDB: Waiting for the background threads to start
120728 17:10:32 InnoDB: 1.1.8 started; log sequence number 1595675
120728 17:10:32 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
120728 17:10:32 [Note] - '0.0.0.0' resolves to '0.0.0.0';
120728 17:10:32 [Note] Server socket created on IP: '0.0.0.0'.
120728 17:10:32 [Note] Event Scheduler: Loaded 0 events
120728 17:10:32 [Note] mysql\bin\mysqld: ready for connections.
Version: '5.5.25a' socket: '' port: 3306 MySQL Community Server (GPL)

Re: Unable to Connect to MySQL Database

PostPosted: 30. July 2012 09:57
by JonB
A. Can you access phpMyAdmin via the XAMPP Welcome page at this time?

B. I don't know HeidiSQL, but I do have an idea what the issue 'might' be. IF you are able to access phpMyAdmin via localhost, HeidiSQL might be trying to make a TCP/IP connect rather than a local socket connection.

C. You might try binding to 127.0.0.1 in your my.ini or my.cnf

Good Luck
8)

Re: Unable to Connect to MySQL Database

PostPosted: 04. August 2012 14:04
by allabakash
The bindaddress was commented out. I uncommented it and it now looks as bind-address="127.0.0.1"
Restarted MySQL.
But the problem still persists.

Re: Unable to Connect to MySQL Database

PostPosted: 04. August 2012 15:22
by JonB
2 questions and a suggestion:

did you reset your 'root' PW as I have suggested?

In a command window, ping localhost and see what it resolves to.

it it only resolves to " ::1 "

try adding a line like this to your hosts file

127.0.0.1 localhost

I'm betting that its a PW issue -
http://www.heidisql.com/forum.php?t=5615

Good Luck

Re: Unable to Connect to MySQL Database

PostPosted: 07. August 2012 14:12
by allabakash
Pinging the local host is resolving to MyName-Laptop.DomainName.com
I've just installed the XAMPP and was trying to access. Not sure how the password might change(as per the heidisql link that you posted).
Is there anyway that the default MySQL installation from xampp has any other password other than blank string?

Re: Unable to Connect to MySQL Database

PostPosted: 07. August 2012 16:39
by legas
JonB wrote:2 questions and a suggestion:

did you reset your 'root' PW as I have suggested?

In a command window, ping localhost and see what it resolves to.

it it only resolves to " ::1 "

try adding a line like this to your hosts file

127.0.0.1 localhost

I'm betting that its a PW issue -
http://www.heidisql.com/forum.php?t=5615


I had the same problem, was searching the answer for such a long time, and the password change did it!! WHOHOOOO You are a king!
Good Luck

Re: Unable to Connect to MySQL Database

PostPosted: 08. August 2012 04:27
by allabakash
legas wrote:
JonB wrote:2 questions and a suggestion:

did you reset your 'root' PW as I have suggested?

In a command window, ping localhost and see what it resolves to.

it it only resolves to " ::1 "

try adding a line like this to your hosts file

127.0.0.1 localhost

I'm betting that its a PW issue -
http://www.heidisql.com/forum.php?t=5615


I had the same problem, was searching the answer for such a long time, and the password change did it!! WHOHOOOO You are a king!
Good Luck

But for changing the password, we should login right?
How did you manage to login to MySQL for changing the password?

Re: Unable to Connect to MySQL Database

PostPosted: 08. August 2012 06:43
by allabakash
My issue got resolved. When I was starting MySQL using xampp control, it was actually starting another MySQL server that was already installed in the Program Files.
I tried starting the MySQL using the batch file provided in the xampp directory. It started and I was able to connect. I deleted the one in the Program files. But still the xampp control is trying to start it from the wrong location. Can you plz suggest me how to resolve this one?

Re: Unable to Connect to MySQL Database

PostPosted: 08. August 2012 12:47
by Altrea
Hi allabakash,

allabakash wrote:I deleted the one in the Program files. But still the xampp control is trying to start it from the wrong location. Can you plz suggest me how to resolve this one?

Your other MySQL instance has registered a Windows Service to start it. If such a service exists XAMPP can't distinguish if this is his own instance or not, and tries to start it.

To solve that issue unregister the MySQL Service. You can simply do that in your Windows cmd (with enhanced administration priviledges)
Code: Select all
sc delete "mysql"


best wishes,
Altrea