| Author |
[CentOS 5.5] MySQL stop gives access denied error
|
Saurabh Pillai
Ranch Hand
Joined: Sep 12, 2008
Posts: 449
|
|
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: 1295
|
|
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)
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14460
|
|
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: 1295
|
|
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.
|
 |
 |
|
|
subject: [CentOS 5.5] MySQL stop gives access denied error
|
|
|