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
sargent240Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
CEHJConnect With a Mentor Commented:
Are you connected to the db from the same host as the one on which the db is running?
0
 
for_yanCommented:

The databse administrator needs to create a schema for you and you should know user and password
0
 
for_yanConnect With a Mentor Commented:

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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
 
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:
'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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.