欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

MySQL 客户端不输入用户名和密码直接连接数据库的2个方法

程序员文章站 2023-12-12 08:02:39
有2个方法 一、可以修改my.ini 配置参数(linux下面是 my.cnf); [quote][client] port=3306 default-character-...

有2个方法
一、可以修改my.ini 配置参数(linux下面是 my.cnf);
[quote][client]
port=3306
default-character-set=utf8
host=localhost
user=root
password=1[/quote]
具体的其他参数都可以在这里修改
二、可以修改环境变量
mysql_host 代表主机名
user 为用户名
mysql_pwd 为密码
更多的参数请自行查看mysql的帮助文档,下面是英文的表格

variable description
cxx the name of your c++ compiler (for running configure ).
cc the name of your c compiler (for running configure ).
cflags flags for your c compiler (for running configure ).
cxxflags flags for your c++ compiler (for running configure ).
dbi_user the default user name for perl dbi.
dbi_trace trace options for perl dbi.
home the default path for the mysql history file is $home/.mysql_history .
ld_run_path used to specify the location of libmysqlclient.so .
mysql_debug debug trace options when debugging.
mysql_group_suffix option group suffix value (like specifying --defaults-group-suffix ).
mysql_histfile the path to the mysql history file. if this variable is set, its value overrides the default for $home/.mysql_history .
mysql_home the path to the directory in which the server-specific my.cnf file resides (as of mysql 5.0.3).
mysql_host the default host name used by the mysql command-line client.
mysql_ps1 the command prompt to use in the mysql command-line client.
mysql_pwd the default password when connecting to mysqld . note that using this is insecure. see section 5.5.6.2, “end-user guidelines for password security”.
mysql_tcp_port the default tcp/ip port number.
mysql_unix_port the default unix socket file name; used for connections to localhost .
path used by the shell to find mysql programs.
tmpdir the directory where temporary files are created.
tz this should be set to your local time zone. see section b.1.4.6, “time zone problems”.
umask the user-file creation mode when creating files. see note following table.
umask_dir the user-directory creation mode when creating directories. see note following table.
user the default user name on windows and netware used when connecting to mysqld .
(0)
打赏 MySQL 客户端不输入用户名和密码直接连接数据库的2个方法 微信扫一扫

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

MySQL 客户端不输入用户名和密码直接连接数据库的2个方法
验证码: MySQL 客户端不输入用户名和密码直接连接数据库的2个方法
Copyright © 2017-2022  保留所有权利. 粤ICP备17035492号-1
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com

上一篇:

下一篇: