Home > Database > Mysql Tutorial > How to set prompt for mysql in linux

How to set prompt for mysql in linux

王林
Release: 2023-06-03 15:12:02
forward
1030 people have browsed it

为 mysql 设置提示符

有时候需要同时连接到多台服务器的,并且操作不同的 mysql,由于 mysql 命令行默认没有用户或主机的提示符,这样容易误操作,所以可以在 /etc/my.cnf 文件中添加以下配置来显示 mysql 的提示符:

[mysql]  prompt="\\u@\\h : \\d \\r:\\m:\\s>"
Copy after login

重新进入 mysql 就这样了:

How to set prompt for mysql in linux

The above is the detailed content of How to set prompt for mysql in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template