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

所属分类: 数据库 / Mysql 阅读数: 2007
收藏 0 赞 0 分享

有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 .
更多精彩内容其他人还在看

MySQL 创建索引(Create Index)的方法和语法结构及例子

MySQL 创建索引(Create Index)的方法和语法结构及例子
收藏 0 赞 0 分享

MYSQL 优化常用方法

如何优化你的MYSQL呢?请看下面:(不错的优化方案)
收藏 0 赞 0 分享

linux mysql 找回密码

linux下mysql忘记密码的解决方法。
收藏 0 赞 0 分享

mysql 动态执行存储过程语句

MSSQL中动态执行sql语句可以使用EXEC()函数。MSSQL中也有类似的函数EXECUTE(),不过不同的是MYSQL中动态执行存储过程语句与MSSQL还是有区别的。
收藏 0 赞 0 分享

MySQL 查找价格最高的图书经销商的几种SQL语句

不同的图书,在不同的经销商的价格不同,我们这里要找到每种图书最高的经销商是谁? 找最低的类似了。
收藏 0 赞 0 分享

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

MySQL 客户端不输入用户名和密码直接连接数据库的2个方法,大家可以测试下。
收藏 0 赞 0 分享

mysql 查询表中平均分最低的班级

查询出dd(user_id,class_no,score)这个表中平均分最低的班级?
收藏 0 赞 0 分享

mysql 左连接、右连接和内连接

以MySql为例。在MySQL数据库中建立两张数据表,并分别插入一些数据。
收藏 0 赞 0 分享

Mysql LONGBLOB 类型存储二进制数据 (修改+调试+整理)

代码来自网络,我学习整理了一下,测试通过,下面的参数需要设置为你自己的
收藏 0 赞 0 分享

Mysql LONGTEXT 类型存储大文件(二进制也可以) (修改+调试+整理)

MySql2.cpp : Defines the entry point for the console application.
收藏 0 赞 0 分享
查看更多