aspose file tools*
The moose likes Linux / UNIX and the fly likes [CentOS 5.5] MySQL stop gives access denied error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "[CentOS 5.5] MySQL stop gives access denied error" Watch "[CentOS 5.5] MySQL stop gives access denied error" New topic
Author

[CentOS 5.5] MySQL stop gives access denied error

Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 498
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

Joined: Dec 08, 2010
Posts: 1456
    
    5

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.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15



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"


Customer surveys are for companies who didn't pay proper attention to begin with.
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1456
    
    5



I missed it...
Nicolo Villarete
Greenhorn

Joined: Mar 20, 2012
Posts: 7

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: [CentOS 5.5] MySQL stop gives access denied error
 
Similar Threads
Slackware & Mysql error install
Newbee Question On Linux
how to redirect from apache to tomcat..?
Installing mysql on Linux
Module Cannot be Deployed