1

I have a user that I use from my php pages to make queries to mysql db, and now I´m trying to use the same user in eclipse/BIRT in order to build some reports but I get the error

Access denied for user 'username'@'localhost' (using password: YES)

Does anyone know what I´m missing?

2
  • Check the table permissions for username? – Thomas Hughes Apr 25 '15 at 19:17
  • What does your BIRT config file look like? I've heard of BIRT defaulting to root even when a username and password if specified. Does the error actually state? Access denied for user 'username'@'localhost' If so, I'm assuming BIRT is not using the correct user, as username won't be the user used to access mysql? – Ankh2054 Apr 26 '15 at 8:38
1

You have to add username@% record where "%" is the wildcard meaning "from anywhere". Or, more securely, you can add record like username@11.22.33.44 or username@mydomain.tld

1

Use the config.sample.inc.php to create your own config.inc.php (in the phpMyAdmin folder) which includes lines like this (the default will probably work for you):

/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
0

The statement of "Access denied for user 'username'@'localhost' (using password: YES)", can surface even before a connection is even made to the database server. I am going to guess this is most likely the issue since I am guessing you know the correct password and I will also make the assumption that you know you have the correct permissions to the tables you are trying to access since you stated you have a user that you use to from your website to make db queries.

You didn't really specify where the eclipse instance is but I am going to guess on a workstation that is not on the same network as your server. I would first make sure that you can make a connection to the database server. MySQL by default runs on port tcp/3306. I would just try making a telnet connection to see if it connects, "telnet (db_server_ip) 3306". If the connection is closed than you will need to open ports from you work station to your db server depending upon the amount of firewalls that are in the way.

1
  • Hi, the first two assumptions are rigth, i know the password and permissions are ok since i work on php pages without trouble, I perform inserts, and selects on every page i have. But the third one is not because my eclipse is in the same machine that apache and mysql so I don´t have to mind for firewalls or any other network problem, I have mysql 5.6 and my driver is 5.1, would it be an issue? Or what else could be the problem? – lestat Apr 26 '15 at 1:19
0

The solution was very simple, I just stop using localhost and changed to the actual IP address.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.