Jump to content


Photo

Easyphp: Access Denied For User 'root '@' Localhost'


  • Please log in to reply
12 replies to this topic

#1 AlikJ

AlikJ

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 March 2010 - 10:12 AM

Hi,
I try to test MySQL like in example on page 159, but I recieve the following error after entering the command:
QUOTE
access denied for user 'root'@'localhost' (using password YES)

I haven't set any passwords or made any changes in EasyPHP configuration, there is no password... what can cause the problem? unsure.gif

#2 Robin Nixon

Robin Nixon

    Active Member

  • O'Reilly Author
  • PipPipPipPip
  • 113 posts
  • Gender:Male
  • Location:UK

Posted 17 March 2010 - 10:21 AM

I assume you mean this command?

CODE
"\Program Files\EasyPHP 3.0\mysql\bin\mysql" -u root

From the error you have mentioned "(using password YES)", MySQL is expecting a password. Are you sure that you entered the command correctly with a space before and after the -u then then the word root?

By default you ought to not yet have a password assigned to the root user so it shouldn't require one if you correctly enter the command to run the program.


#3 AlikJ

AlikJ

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 March 2010 - 10:35 AM

QUOTE
Are you sure that you entered the command correctly with a space before and after the -u then then the word root?


Yes, I pasted it from the book (I have the same location as in the book example) and haven't installed EasyPHP before on this system... That's all strange huh.gif

#4 Robin Nixon

Robin Nixon

    Active Member

  • O'Reilly Author
  • PipPipPipPip
  • 113 posts
  • Gender:Male
  • Location:UK

Posted 17 March 2010 - 11:37 AM

Perhaps you have MySQL already installed (from some other product) and with a password assigned to root? The only way around this that I can think of is to uninstall MySQL and ensure it's completely removed (including settings), and then reinstall it.

This might require a complete uninstall and reinstall of Easy PHP. So instead you might consider installing Zend Server CE, which is from the developers of PHP, and is in my opinion even better than Easy PHP. It's free and is available at: http://www.zend.com/...ucts/server-ce/

#5 AlikJ

AlikJ

    New Member

  • Members
  • Pip
  • 5 posts

Posted 17 March 2010 - 11:58 AM

The only reason I use EasyPhp - because it is used in the book. I hope Zend Server is not too complicated and I will be able to test the book's material with it.

#6 Robin Nixon

Robin Nixon

    Active Member

  • O'Reilly Author
  • PipPipPipPip
  • 113 posts
  • Gender:Male
  • Location:UK

Posted 17 March 2010 - 10:37 PM

Zend Server CE wasn't released when the book was written, but the next edition of the book will use that and not Easy PHP precisely because it is an even easier product, so don't worry about that - I think you'll do just fine with it.

#7 AlikJ

AlikJ

    New Member

  • Members
  • Pip
  • 5 posts

Posted 18 March 2010 - 03:45 AM

The field password was set to "mysql" (EasyPHP->MySql->CLIENT SECTION), I deleted the password and now MySQL works... But I wonder why the field was not empty by default?

#8 woolamander

woolamander

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 June 2010 - 09:57 AM

I have been having the same problem. When I type the command from page 159 into CMD, I get the error:

ERROR 1045 <28000>: Acess denied for user 'root'@'localhost' (using password:YES)

I have looked in my Phpmyadmin folder and made sure that the password is blank. Interestingly, when I access MySQL through PHPMyAdmin on my browser (http://localhost/home/mysql/) it logs in the MySQL just fine. If I change the password in the config file, it won't log in from the browser, but as long as the password is blank, I can log in from my browser. Still, nothing will allow me to access MySQL from CMD.

The PHPMyAdmin MySQL parameters are

MySQL parameters (default MySQL account)
- Host : 'localhost'
- Username : 'root'
- Password : '' (no password)
- Path to the database root (datadir) : C:\Program Files\EasyPHP-5.3.2i\mysql\data\

The password and username match what is in my config file.

Ack!

#9 woolamander

woolamander

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 June 2010 - 09:09 PM

For more reference, here is what my config.inc.php says:

<?php
/*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.phpmyadmin.net>.
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

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

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';

$cfg['Servers'][$i]['hide_db'] = '(mysql|information_schema|phpmyadmin)';
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/* rajk - for blobstreaming */
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';

/* User for advanced features */
// $cfg['Servers'][$i]['controluser'] = 'root';
// $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]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
* End of servers configuration
*/

/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

?>


#10 woolamander

woolamander

    New Member

  • Members
  • Pip
  • 3 posts

Posted 10 June 2010 - 12:30 PM

I got it.

I typed in

"\Program Files\EasyPHP-5.3.2i\mysql\bin\mysql" -u root -p

and then pressed enter when Password: came up.

#11 alfredough

alfredough

    New Member

  • Members
  • Pip
  • 1 posts

Posted 29 August 2011 - 04:24 PM

I got it.

I typed in

"\Program Files\EasyPHP-5.3.2i\mysql\bin\mysql" -u root -p

and then pressed enter when Password: came up.


I had to do the same thing. If I do not specify the -p argument, I get the error message:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Edited by alfredough, 29 August 2011 - 04:26 PM.


#12 simbadzina

simbadzina

    New Member

  • Members
  • Pip
  • 1 posts

Posted 10 April 2012 - 06:28 PM

Thank you people

"mysql -u root -p" worked :-)

#13 sinicline

sinicline

    New Member

  • Members
  • Pip
  • 7 posts
  • Gender:Male

Posted 12 April 2012 - 07:37 PM

To uninstall MySQL and ensure it's completely removed (including settings), and then reinstall it. This might require a complete uninstall and reinstall of Easy PHP.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users