MySQL 客戶端不輸入用戶名和密碼直接連接數(shù)據(jù)庫的2個(gè)方法
更新時(shí)間:2009年07月07日 02:10:41 作者:
MySQL 客戶端不輸入用戶名和密碼直接連接數(shù)據(jù)庫的2個(gè)方法,大家可以測(cè)試下。
有2個(gè)方法
一、可以修改my.ini 配置參數(shù)(linux下面是 my.cnf);
[quote][client]
port=3306
default-character-set=utf8
host=localhost
user=root
password=1[/quote]
具體的其他參數(shù)都可以在這里修改
二、可以修改環(huán)境變量
MYSQL_HOST 代表主機(jī)名
USER 為用戶名
MYSQL_PWD 為密碼
更多的參數(shù)請(qǐng)自行查看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 . |
您可能感興趣的文章:
相關(guān)文章
在WIN命令提示符下mysql 用戶新建、授權(quán)、刪除,密碼修改
一般情況下,修改MySQL密碼,授權(quán),是需要有mysql里的root權(quán)限的,本操作是在WIN命令提示符下,感興趣的朋友可以參考下2013-11-11MySQL數(shù)據(jù)庫多表操作通關(guān)指南(外鍵約束和多表聯(lián)合查詢)
看再多的資料不如自己親自動(dòng)手實(shí)戰(zhàn),往往實(shí)戰(zhàn)才能滲透知識(shí),下面這篇文章主要給大家介紹了關(guān)于MySQL數(shù)據(jù)庫多表操作的相關(guān)資料,包含外鍵約束和多表聯(lián)合查詢等,需要的朋友可以參考下2022-06-06mysql(5.6及以下)解析json的方法實(shí)例詳解
這篇文章主要介紹了mysql(5.6及以下)解析json的方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值 ,需要的朋友可以參考下2019-07-07VMWare linux mysql 5.7.13安裝配置教程
這篇文章主要為大家詳細(xì)介紹了VMWare linux mysql 5.7.13安裝配置教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-05-05淺談mysql導(dǎo)出表數(shù)據(jù)到excel關(guān)于datetime的格式問題
這篇文章主要介紹了淺談mysql導(dǎo)出表數(shù)據(jù)到excel關(guān)于datetime的格式問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2020-07-07