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 LONGBLOB 类型存储二进制数据 (修改+调试+整理)
在DBMS中线要创建数据库test,table bintest,data字段数据类型用LONGBLOB即可测试 //测试文件c:\\... [阅读全文] -
不用担心啊,你担心之前绝对有人担心过了。哈哈,如果想像mssql中那样可视化操作,可以使用mysql administrator,这... [阅读全文]
-
mysql 字符串函数大全 对于针对字符串位置的操作,第一个位置被标记为1。 ascii(str) 返回字符串str的最左面字符的a... [阅读全文]
-
在北美,人们对于 postgresql 的热情不断升温。随着 postgresql 的发展, postgresql 8.x 已经从技... [阅读全文]
-
最多16列。 create table test ( f1 int, f2 int, f3 int, f4 int, f5 int,... [阅读全文]
-
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论