mysql after sudo su works; mysql or sudo mysql fails

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I was visiting a mysql installation (don't know the details)



[user@host ~]$ mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


Checked, and password I was given seems correct. I noticed in the sample I'd been given, they had been running as root.



[user@host ~]$ sudo mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


[Sudoers has wheel with NOPASSWD.] Ok, that's not it. Or is it?



[user@host ~]$ sudo su
[root@host user]# mysql -u kco -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 196356
Server version: 5.1.73 Source distribution


Odd. Thought it might be a socket permission thing, but



[root@host user]# ls -l /var/lib/mysql/mysql.sock
srwxrwxrwx. 1 mysql mysql 0 Mar 19 18:39 /var/lib/mysql/mysql.sock


Hm. Got a quick downvote, so let me be more explicit in the question. The desired result would be for a regular user to be able to mysql -u kco -p . Why does it require a root shell (not sudo) to access the UI?







share|improve this question



















  • sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
    – jc__
    May 30 at 14:13










  • I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
    – Woody Weaver
    Jun 2 at 3:04














up vote
0
down vote

favorite












I was visiting a mysql installation (don't know the details)



[user@host ~]$ mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


Checked, and password I was given seems correct. I noticed in the sample I'd been given, they had been running as root.



[user@host ~]$ sudo mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


[Sudoers has wheel with NOPASSWD.] Ok, that's not it. Or is it?



[user@host ~]$ sudo su
[root@host user]# mysql -u kco -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 196356
Server version: 5.1.73 Source distribution


Odd. Thought it might be a socket permission thing, but



[root@host user]# ls -l /var/lib/mysql/mysql.sock
srwxrwxrwx. 1 mysql mysql 0 Mar 19 18:39 /var/lib/mysql/mysql.sock


Hm. Got a quick downvote, so let me be more explicit in the question. The desired result would be for a regular user to be able to mysql -u kco -p . Why does it require a root shell (not sudo) to access the UI?







share|improve this question



















  • sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
    – jc__
    May 30 at 14:13










  • I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
    – Woody Weaver
    Jun 2 at 3:04












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I was visiting a mysql installation (don't know the details)



[user@host ~]$ mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


Checked, and password I was given seems correct. I noticed in the sample I'd been given, they had been running as root.



[user@host ~]$ sudo mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


[Sudoers has wheel with NOPASSWD.] Ok, that's not it. Or is it?



[user@host ~]$ sudo su
[root@host user]# mysql -u kco -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 196356
Server version: 5.1.73 Source distribution


Odd. Thought it might be a socket permission thing, but



[root@host user]# ls -l /var/lib/mysql/mysql.sock
srwxrwxrwx. 1 mysql mysql 0 Mar 19 18:39 /var/lib/mysql/mysql.sock


Hm. Got a quick downvote, so let me be more explicit in the question. The desired result would be for a regular user to be able to mysql -u kco -p . Why does it require a root shell (not sudo) to access the UI?







share|improve this question











I was visiting a mysql installation (don't know the details)



[user@host ~]$ mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


Checked, and password I was given seems correct. I noticed in the sample I'd been given, they had been running as root.



[user@host ~]$ sudo mysql -u kco -p
Enter password:
ERROR 1045 (28000): Access denied for user 'kco'@'localhost' (using password: YES)


[Sudoers has wheel with NOPASSWD.] Ok, that's not it. Or is it?



[user@host ~]$ sudo su
[root@host user]# mysql -u kco -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 196356
Server version: 5.1.73 Source distribution


Odd. Thought it might be a socket permission thing, but



[root@host user]# ls -l /var/lib/mysql/mysql.sock
srwxrwxrwx. 1 mysql mysql 0 Mar 19 18:39 /var/lib/mysql/mysql.sock


Hm. Got a quick downvote, so let me be more explicit in the question. The desired result would be for a regular user to be able to mysql -u kco -p . Why does it require a root shell (not sudo) to access the UI?









share|improve this question










share|improve this question




share|improve this question









asked May 29 at 21:08









Woody Weaver

6




6











  • sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
    – jc__
    May 30 at 14:13










  • I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
    – Woody Weaver
    Jun 2 at 3:04
















  • sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
    – jc__
    May 30 at 14:13










  • I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
    – Woody Weaver
    Jun 2 at 3:04















sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
– jc__
May 30 at 14:13




sudo is modifying the linux user, mysql -u databaseUser -p is a user setup in mysql. Normally mysql does not require linux root access, sudo. Only a mysql user who may have mysql root access. Example able to create and delete databases.
– jc__
May 30 at 14:13












I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
– Woody Weaver
Jun 2 at 3:04




I understand, that's why this is puzzling. Authentication and authorization in mysql is controlled by entries in a table, and should have nothing to do with effective uid; and the sudo mysql should not be different from sudo su then mysql. Yet that is the observed behaviour...
– Woody Weaver
Jun 2 at 3:04















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446794%2fmysql-after-sudo-su-works-mysql-or-sudo-mysql-fails%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446794%2fmysql-after-sudo-su-works-mysql-or-sudo-mysql-fails%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay