MySQL client directly connects to the database without entering the user name and password _ MySQL

Source: Internet
Author: User
Two methods for MySQL client to directly connect to the database without entering the user name and password bitsCN.com

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 runningConfigure).
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 forMysqlHistory 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 toMysqlHistory 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-specificmy.cnfFile resides (as of MySQL 5.0.3 ).
MYSQL_HOST The default host name used byMysqlCommand-line client.
MYSQL_PS1 The command prompt to use inMysqlCommand-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 connectionslocalhost.
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 connectingMysqld.
BitsCN.com

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.