#1045 Cannot log in to the MySQL server
Posted by: seastar (---.mehmetakif.edu.tr)
Date: July 23, 2014 11:35AM

I have Windows 7 Professional and I installed WampSever Version 2.2 that includes:


Apache 2.2.21
PHP 5.3.8
MYSQL 5.5.16

Color of WampServer is Orange, and my config.inc.php looks like:

<?php



/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['verbose'] = 'mysql wampserver';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysql if your server does not have mysqli */
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;


$cfg['LoginCookieValidity'] = 60 * 60 * 8;


?>

The problem is, when I open phpmyadmin, it requires username and password.

Then I fill in:

username: root
password: NULL

the error on phpMyAdmin page is is ''#1045 Cannot log in to the MySQL server''.

Help Please?

Options: ReplyQuote
Re: #1045 Cannot log in to the MySQL server
Posted by: seastar (---.mehmetakif.edu.tr)
Date: July 23, 2014 11:49AM

Also, I do not have a HOSTS file. on [c:\windows\system32\drivers\etc\hosts]

Options: ReplyQuote
Re: #1045 Cannot log in to the MySQL server
Posted by: RiggsFolly (---.dynamic.dsl.as9105.com)
Date: July 23, 2014 01:37PM

If the wampmanager icon is not GREEN then one of the services ( Apache(wampapache)/MySQL(wampmysqld) ) has not started properly.

How to tell which service is not running if the wampmanager icon is orange.

Left click the wampmanager icon to reveal the menu-> Apache -> Service
If the Start/Resume service menu is Green then Apache IS NOT running.

Left click the wampmanager icon to reveal the menu-> MySQL -> Service
If the Start/Resume service menu is Green then MySQL IS NOT running.




It sounds like MySQL has not started as you can get to the login for phpMyAdmin which would require Apache.


The normal reason for this is that you have tried to install MySQL and/or Apache manually, given up, found WAMPServer and installed that before properly removing the other MySQL Server installation.

So uninstall the other MySQL if that is what happened.

Other reasons can be that you have another tool that brings MySQL Server with it!
That is more complicated to work around unless you no longer need this other product.

Also check for 'my.ini' and 'my.cnf' files anywhere on your C: drive ( they are normally in C:\windows\ or below somewhere) this can also mess up a WAMPServer Installation



Hope this helps, if you are in anyway confused, post a little more nfo and we can wee what we can do.




RE: Hosts file

You must have one, as it comes with the basic install of windows, unless you or someone deleted it.

Its a file that windows protects so you may need to be an Admin to see it, and definitely need to launch your editor using 'Run as Administrator' to make changes to it.


It should contain as a minimum these lines


127.0.0.1  locahost
::1   localhost

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: #1045 Cannot log in to the MySQL server
Posted by: seastar (---.mehmetakif.edu.tr)
Date: July 23, 2014 02:49PM

That was very helpful, thankssmiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.