MySQL 客户端不输入用户名和密码直接连接数据库的2个方法
发布时间:2024-01-14 05:30:41
标签:MySQL,客户端
有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的帮助文档,下面是英文的表格
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 . |


猜你喜欢
- 新建一个项目之后,我们来看一下项目的目录结构几个主要文件的内容index.html文件(入口文件,系统进入之后先进入index.html)&
- 本文实例为大家分享了python抓取网页中链接的静态图片的具体代码,供大家参考,具体内容如下# -*- coding:utf-8 -*- #
- 1.锁生活中:锁在我们身边无处不在,比如我出门玩去了需要把门锁上,比如我需要把钱放到保险柜里面,必须上锁以保证我财产的安全。代码中:比如多个
- 1.包: package PaintBrush; /** * * @author lucifer */ public class Paint
- 以前用js很少用到js的正则表达式,即使用到了,也是诸如邮件名称之类的判断,网上代码很多,很少有研究,拿来即用。最近开发遇到一些需要使用正则
- 使用$http.post请求传参的错误在使用$http请求后台,照常我们在后端 使用注解@PostMapper或者 @RequestMapp
- 问题:关于如何生成随机记录(二)如何从指定表中随机抽取一定量的记录?sql server 中 select top 10 * fr
- 众所周知IE6不支持position:fixed,这个bug与IE6的双倍margin和不支持PNG透明等bug一样臭名昭著。前些天我做自己
- 前言numpy支持对矩阵和数组进行运算,因此很多numpy的很多运算都需要指定操作的维数参数axis(当然这些axis都有带默认值的),本博
- 锁类型介绍MySQL 有三种锁的级别:页级、表级、行级1 表级锁:开销小,加锁快;不会出现死锁;锁定粒度大,发生锁冲突的概率最高, 并发度最
- sql语句 代码如下:reverse(substring(reverse(Path),1,charindex('/'
- 表结构学生表如下:CREATE TABLE `t_student` ( `id` int NOT NULL AUTO_INCRE
- 背景环境:ArcGis10.2.2。C#开发程序一直以来以调用Desktop的python环境(32位)来做数据处理分析。但是数据量大时,出
- 记得很早以前看到过这样的一段介绍:想象你在逛街边的一家书店,如果最终你没有购买任何图书就直接离开了,店长并不会知道你来过。但是如果你买了书,
- 写一个类似linux head的小工具,在window下用。head.py # -*- coding: UTF-8 -*-#!/u
- 一、什么是数据驱动测试DDT:data drive test准备一组数据,通过写一个测试用例,不同的数据进行迭代。二、csv文件承载数据CS
- 最近看《python核心编程》,书中实现了一个简单的1对1的TCPserver,但是在实际使用中1对1的形势明显是不行的,所以研
- 如下代码可以计算输入的两张图像的结构相似度(SSIM),结果与matlab计算结果一致// An highlighted blockimpo
- 一、整数python2中整形可以分为一般整形和长整形,但是在python3中,两者以及合二为一了,只有整形。python中的整形是具有无限精
- 错误如图所示:图一 如果不能很好地执行登录触发器,那么将会导致登录失败。 例如,如果创建了这个触发器,那么就可以设计下面的代码来达到失败的目