I.e., the following syntax’s work.
$ mysql$ sudo su - -c mysql$ sudo su - ; mysql
but the following does not.
$ sudo mysql
The trick is actually to ensure via /etc/sudoers you inherit the MySQL_PS1 environment variable.
echo "export MYSQL_PS1=/"`hostname` [/d]> /"" | sudo tee /etc/profile.d/mysql.shecho 'Defaultsenv_keep += "MYSQL_PS1"' | sudo tee /tmp/mysqlsudo chmod 400 /tmp/mysqlsudo mv /tmp/mysql /etc/sudoers.d
Tags:mysql client,mysql prompt,MYSQL_PS1,sudo
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com