How to disable way of interactive password specification when login to mysql database in command line

shivakumar7

Registered
Apr 19, 2022
3
0
1
Bangalore
cPanel Access Level
Root Administrator
Hi team,
My requirement is " I should not allow root/users who specify interactive password while login to mysql database in command line" like 'mysql -uroot -pMYpasswordhere' ,this way of entering password on command line leads to security threats .Entered command can be found when we check 'History' & process list so how we can make root/users allow to login only Entering password when prompted ,like 'mysql -uroot -p' after press enter we will get 'Enter password ' pop up at that time if root/users specify password then only allow to login to mysql database if not it should through some warnings or message saying password specification on command line not allowed .
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,597
2,615
363
cPanel Access Level
Root Administrator
Hey there! I looked through the MySQL documentation and I didn't find a way to disable this. With the details you outlined though, even if it were disabled, it wo uld still show up in the server's command line history since "mysql -u username -p password" would need to be entered for the warning to be triggered.
 
  • Like
Reactions: shivakumar7