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

2016-02-19 09:55 4 1 收藏

下面是个简单易学的MySQL 客户端不输入用户名和密码直接连接数据库的2个方法教程,图老师小编详细图解介绍包你轻松学会,喜欢的朋友赶紧get起来吧!

【 tulaoshi.com - 编程语言 】

有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的帮助文档,下面是英文的表格

(本文来源于图老师网站,更多请访问https://www.tulaoshi.com/bianchengyuyan/)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 .

来源:https://www.tulaoshi.com/n/20160219/1592675.html

延伸阅读
标签: Web开发
create table test(test1 varchar(20),test2 varchar(20) 然后向这个表写入一条测试纪录 那么现在开始我们的jsp和数据库之旅吧。   testoracle.jsp如下: %@ page contentType="text/html;charset=gb2312"%    %@ page import="java.sql.*"% html    body &nb...
一个程序连接数据库中间就需要有一个数据库连接引擎 笔者在使用Delphi的过程中,共使用过几种连接方式连接Access,SqlServer,Oracle,IBM UDB,IBM AS/400... 1.BDE     这是使用Delphi最多的一种方式,建立一个BDE别名可以在控制面板中的BDE Administration中添加,不过我习惯在SQL Explorer中建立,因为...
标签: ASP
  下面将简单介绍一下几种ADO连接方式:ODBC DSN,ODBC DSN-Less, OLE DB Provider,和"MS Remote" Provider. 1。ODBC DSN连接 I.DSN     oConn.Open "DSN=AdvWorks;" & _         "UID=Admin;" & _      ...
unit Unit1; interface uses   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,   StdCtrls, DB, DBTables, ComCtrls, Grids, DBGrids, ExtCtrls,   DBCtrls, Mask, ImgList; type   TForm1 = class(TForm)     TreeView1: TTreeView; ...
ODBC数据源 1. 什么是ODBC ODBC(Open Database Connectivity,开放式数据库互联),是目前国际上通用的数据库访问标准。 2. 什么是ODBC数据源 就是计算机上的ODBC配置和管理的工具,利用这个工具,用户就可以定制使用ODBC来连接数据库。 Oracle 9i客户机 VB程序连接数据库的过程分析 1. VB程序指定...

经验教程

319

收藏

52
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部