Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[CentOS 5.5] MySQL stop gives access denied error

 
Saurabh Pillai
Ranch Hand
Posts: 524
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am in /etc/init.d directory.



Why first command gives error(even though I am in proper directory) while second command works OK?
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saurabh Pillai,

Firstly, I'm not mysql expert, however, below are my guesses:

1) My first guess was, you are using mysql command without password (and you provided password in config file), and that is the reason for 'using password: NO' thing.
2) However, your second command is interesting. It works with full path, but doesn't work with simple command. As of this, my (another) guess is - path defined for mysql in PATH variable is different from actual path (or more than 1 versions of mysql are there etc.).

I hope this helps.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Oh this is a good one!

The reason is quite simple.

The first command is invoking the mysql client application program. The root user has not been given mysql access rights to the database named "stop" when accessing from localhost.

The second command works, because it's a shell script that controls the actual mysql server daemon. Except I thought its name was supposed to be "mysqld"
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I missed it...
 
Nicolo Villarete
Greenhorn
Posts: 7
Eclipse IDE Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are totally 2 different commands, the one in init.d is a script (you can proly check by using cat mysql inside init.d folder) and the mysql(anywhere) on the first one is also different(proly the one in /usr/bin you can check by using which command 'which mysql') . I think the one you need is the 2nd one. the first one is the client app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic