Two Methods for MYSQL client to directly connect to the database without entering the user name and password

Source: Internet
Author: User

There are 2 methods
1. You can modify the configuration parameters of my. ini (My. CnF in Linux );
[Quote] [client]
Port = 3306
Default-character-set = utf8
Host = localhost
User = root
Password = 1 [/quote]

You can modify other parameters here.

2. You can modify environment variables.
Mysql_host represents the Host Name
User is the user name
Mysql_pwd is the password



For more parameters, see the MySQL help documentation. The following is a table in English.

Variable

Description

CXX
The name of your c ++ Compiler (for running
Configure
).
CC
The name of your C compiler (for runningConfigure
).
CFLAGS
Flags for your C compiler (for runningConfigure
).
CXXFLAGS
Flags for your c ++ Compiler (for runningConfigure
).
DBI_USER
The Default User Name For Perl DBI.
DBI_TRACE
Trace options for Perl DBI.
HOME
The default path forMySQL
History file is
$HOME/.mysql_history
.
LD_RUN_PATH
Used to specify the locationlibmysqlclient.so
.
MYSQL_DEBUG
Debug trace options when debugging.
MYSQL_GROUP_SUFFIX
Option group suffix value (like specifying
--defaults-group-suffix
).
MYSQL_HISTFILE
The path toMySQL
History file. If this variable
Is set, its value overrides the default
$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 byMySQL
Command-line
Client.
MYSQL_PS1
The command prompt to use inMySQL
Command-line
Client.
MYSQL_PWD
The default password when connectingMysqld
. 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
localhost
.
PATH
Used by the shell to find MySQL programs.
TMPDIR
The directory where temporary files are created.
TZ
This shoshould 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
Mysqld
.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.