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

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

WBOY
Release: 2016-06-07 18:01:17
Original
1120 people have browsed it

MySQL 客户端不输入用户名和密码直接连接数据库的2个方法,大家可以测试下。

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template