O'Reilly Forums: Easyphp: Access Denied For User 'root '@' Localhost' - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   AlikJ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 15-March 10

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
0

#2 User is offline   Robin Nixon 

  • Active Member
  • PipPipPipPip
  • Group: O'Reilly Author
  • Posts: 113
  • Joined: 26-June 09
  • 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.

0

#3 User is offline   AlikJ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 15-March 10

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
0

#4 User is offline   Robin Nixon 

  • Active Member
  • PipPipPipPip
  • Group: O'Reilly Author
  • Posts: 113
  • Joined: 26-June 09
  • 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/en/products/server-ce/
0

#5 User is offline   AlikJ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 15-March 10

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.
0

#6 User is offline   Robin Nixon 

  • Active Member
  • PipPipPipPip
  • Group: O'Reilly Author
  • Posts: 113
  • Joined: 26-June 09
  • 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.
0

#7 User is offline   AlikJ 

  • New Member
  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 15-March 10

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?
0

#8 User is offline   woolamander 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-June 10

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!
0

#9 User is offline   woolamander 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-June 10

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'] = '';

?>

0

#10 User is offline   woolamander 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 09-June 10

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.
0

#11 User is offline   alfredough 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 29-August 11

Posted 29 August 2011 - 04:24 PM

 woolamander, on 10 June 2010 - 12:30 PM, said:

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)

This post has been edited by alfredough: 29 August 2011 - 04:26 PM

0

#12 User is offline   simbadzina 

  • New Member
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 10-April 12

Posted 10 April 2012 - 06:28 PM

Thank you people

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

#13 User is offline   sinicline 

  • New Member
  • Pip
  • Group: Members
  • Posts: 7
  • Joined: 18-December 11
  • 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.
[url="http://www.sinicline.net"]My link[/url]
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users