MySQL 客戶端不輸入用戶名和密碼直接連接數(shù)據(jù)庫的2個(gè)方法
更新時(shí)間:2009年07月07日 02:10:41 作者:
MySQL 客戶端不輸入用戶名和密碼直接連接數(shù)據(jù)庫的2個(gè)方法,大家可以測試下。
有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ù)請自行查看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)文章
mysql中的四大運(yùn)算符種類實(shí)例匯總(20多項(xiàng))?
這篇文章主要介紹了mysql中的四大運(yùn)算符種類匯總,運(yùn)算符連接表達(dá)式中的各個(gè)操作數(shù),他的作用是用來指明對數(shù)據(jù)表中的操作數(shù)所進(jìn)行的運(yùn)算2022-07-07
MySQL常見數(shù)據(jù)類型知識(shí)點(diǎn)舉例詳解
這篇文章主要介紹了MySQL數(shù)據(jù)庫中各種數(shù)據(jù)類型,包括整數(shù)類型、浮點(diǎn)數(shù)類型、定點(diǎn)數(shù)類型、字符串類型、日期類型、時(shí)間類型、enum類型和set類型,每種類型都有其特定的用途和特性,文中通過代碼介紹的非常詳細(xì),需要的朋友可以參考下2025-02-02
MySQL json相關(guān)函數(shù)及功能詳解
MySQL提供了一系列的JSON函數(shù),用于解析、提取、修改和操作JSON數(shù)據(jù),以下是一些常用的JSON函數(shù)及其功能,需要的朋友可以參考下2023-11-11
MySQL與PHP的基礎(chǔ)與應(yīng)用專題之表連接
MySQL是一個(gè)關(guān)系型數(shù)據(jù)庫管理系統(tǒng),由瑞典MySQL?AB?公司開發(fā),屬于?Oracle?旗下產(chǎn)品。MySQL?是最流行的關(guān)系型數(shù)據(jù)庫管理系統(tǒng)之一,本系列將帶你掌握php與mysql的基礎(chǔ)應(yīng)用,本篇表連接開始2022-02-02
MySQL派生表合并優(yōu)化的原理和實(shí)現(xiàn)過程
本文從一個(gè)案例出發(fā)梳理了MySQL派生表合并優(yōu)化的流程實(shí)現(xiàn)和優(yōu)化原理,并對優(yōu)化前后同一條SQL語句在代碼層面的類實(shí)例映射關(guān)系進(jìn)行了對比,這篇文章主要介紹了MySQL派生表合并優(yōu)化的原理和實(shí)現(xiàn),需要的朋友可以參考下2024-07-07
MySQL內(nèi)連接和外連接及七種SQL?JOINS的實(shí)現(xiàn)
這篇文章主要介紹了Mysql內(nèi)連接和外連接的區(qū)別以及七種SQL?Joins的實(shí)現(xiàn),相信看完這篇文章你對SQL內(nèi)外連接的多表查詢就足夠理解了,需要的朋友可以參考下2023-03-03
最新評論
最近更新的內(nèi)容
- MySQL流程控制IF()、IFNULL()、NULLIF()、ISNULL
- Mysql表如何按照日期字段的年月分區(qū)
- mysql服務(wù)性能優(yōu)化—my.cnf_my.ini配置說明詳解(16G內(nèi)存)
- Mysql時(shí)間軸數(shù)據(jù) 獲取同一天數(shù)據(jù)的前三條
- clickhouse復(fù)雜時(shí)間格式的轉(zhuǎn)換方式
- CentOS系統(tǒng)下如何設(shè)置mysql每天自動(dòng)備份
- 關(guān)于MySQL與Golan分布式事務(wù)經(jīng)典的七種解決方案
- 簡單實(shí)現(xiàn)SQLServer轉(zhuǎn)MYSQL的方法
- 你知道m(xù)ysql哪些查詢情況不走索引嗎
- MySQL substr函數(shù)使用方法詳解

