源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2020-04-21 02:23 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:MySQL 客户端不输入用户名和密码直接连接数据库的2个方法
有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的帮助文档,下面是英文的表格
[b]Variable[/b] [b]Description[/b]
[code]CXX[/code] The name of your C++ compiler (for running configure ).
[code]CC[/code] The name of your C compiler (for running configure ).
[code]CFLAGS[/code] Flags for your C compiler (for running configure ).
[code]CXXFLAGS[/code] Flags for your C++ compiler (for running configure ).
[code]DBI_USER[/code] The default user name for Perl DBI.
[code]DBI_TRACE[/code] Trace options for Perl DBI.
[code]HOME[/code] The default path for the mysql history file is [code]$HOME/.mysql_history[/code] .
[code]LD_RUN_PATH[/code] Used to specify the location of [code]libmysqlclient.so[/code] .
[code]MYSQL_DEBUG[/code] Debug trace options when debugging.
[code]MYSQL_GROUP_SUFFIX[/code] Option group suffix value (like specifying [code]--defaults-group-suffix[/code] ).
[code]MYSQL_HISTFILE[/code] The path to the mysql history file. If this variable is set, its value overrides the default for [code]$HOME/.mysql_history[/code] .
[code]MYSQL_HOME[/code] The path to the directory in which the server-specific [code]my.cnf[/code] file resides (as of MySQL 5.0.3).
[code]MYSQL_HOST[/code] The default host name used by the mysql command-line client.
[code]MYSQL_PS1[/code] The command prompt to use in the mysql command-line client.
[code]MYSQL_PWD[/code] 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”.
[code]MYSQL_TCP_PORT[/code] The default TCP/IP port number.
[code]MYSQL_UNIX_PORT[/code] The default Unix socket file name; used for connections to [code]localhost[/code] .
[code]PATH[/code] Used by the shell to find MySQL programs.
[code]TMPDIR[/code] The directory where temporary files are created.
[code]TZ[/code] This should be set to your local time zone. See Section B.1.4.6, “Time Zone Problems”.
[code]UMASK[/code] The user-file creation mode when creating files. See note following table.
[code]UMASK_DIR[/code] The user-directory creation mode when creating directories. See note following table.
[code]USER[/code] The default user name on Windows and NetWare used when connecting to mysqld .
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部