• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 226
  • Last Modified:

Mysql permissions

When I execute my program I get the  mysql error

Connect Database SQLException: Access denied for user 'user'@'localhost' (using password:YES)

The only way I can run the program is as root and I would like to run it as a regular user
0
sargent240
Asked:
sargent240
  • 6
  • 5
  • 3
2 Solutions
 
for_yanCommented:

The databse administrator needs to create a schema for you and you should know user and password
0
 
for_yanCommented:

The command should be something like that:
CREATE USER 'test'@'localhost' IDENTIFIED BY 'your_password';
read this:
http://www.iis-aid.com/articles/how_to_guides/creating_a_mysql_user_via_the_command_line
0
 
sargent240Author Commented:
yan: I logged on as root, brought up mysql, and executed the command you suggested.  I then enter the command

SELECT user FROM mysql.user;

and got the following list

al
root
root

root

al root

The list appears exactly like it appeared on my computer including the blank lines.  I redid the passwords and the problem still appears.
Any thoughts?  Thankss
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
for_yanCommented:

can you login to your mysql database atthe command line - try to login as different user
not as root
0
 
sargent240Author Commented:
when I try to log in as anything but root I get an access denied error.
0
 
CEHJCommented:
>>when I try to log in as anything but root I get an access denied error.

Please post the command you used
0
 
sargent240Author Commented:
At the command line prompt I simply type:

mysql

and hit the enter key.  If I do it as root I get the mysql prompt, if I do it as another user I get the error.
0
 
CEHJCommented:
Try this command as another user - it should prompt you for that user's password
mysql -u anotheruser -p

Open in new window

0
 
sargent240Author Commented:
Your suggested command allows me to access mysql from the prompt as a user other than root.  As you can see from my original post my ultimate problem is getting an access denied error when executing my application.  That problem still exists.  Any ideas?
0
 
CEHJCommented:
Are you connected to the db from the same host as the one on which the db is running?
0
 
CEHJCommented:
'connected' should be 'connecting'
0
 
sargent240Author Commented:
A couple of good hands!
0
 
CEHJCommented:
:)
0
 
sargent240Author Commented:
Don't know what to think of your last post CEHJ
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now