如何在没有安装服务器的情况下为MySQL Workbench设置客户端配置? [英] How can I set client configuration for MySQL Workbench without an installed server?

查看:83
本文介绍了如何在没有安装服务器的情况下为MySQL Workbench设置客户端配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我没有服务器就在Windows 7上安装了MySQL工作台,并且我正在连接到远程服务器.
如何为工作台设置客户端配置(如"my.ini"中的[client]部分)?
还是我弄错了方式,客户端从它所连接的服务器上加载了配置?

Say I have installed MySQL workbench on windows 7 without a server, and I'm connecting to a remote server.
How can I set client configuration (like the [client] section in 'my.ini') for the workbench?
Or maybe I get it the wrong way and the client loads the configuration from the server that it connects to?

更新:

也许我还不够清楚.我要设置的配置是在每个事务开始时运行的命令行,例如:

Maybe I wasn't clear enough. The configuration I'm trying to set is command lines to run at the beginning of each transaction, such as:

SET autocommit=0;
SET tx_isolation='READ-COMMITTED';

如果我的计算机上安装了MySQL服务器,则可以将以下行添加到安装文件夹中的"my.ini"文件中:

If MySQL server is installed on my machine, then I can add the following lines to the 'my.ini' file in the installation folder:

[client]
init-command="SET autocommit=0; SET tx_isolation='READ-COMMITTED'"

推荐答案

您很久以前曾问过这个问题,所以也许这与您不再相关,但我将在此处提供一种使他人受益的方法.

You asked this a long time ago, and so maybe this is no longer relevant to you, but I will include a way of doing this here to benefit others.

在Workbench中打开您的连接属性.在连接"选项卡上,选择高级"选项卡.在其中的其他"部分中添加以下两个选项(显然,将readDefaultFile位置更改为my.ini的位置).

In Workbench open your connection properties. On the Connection Tab, select the Advanced Tab. In there add the following two options to the Others section (obviously change the readDefaultFile location to the location of your my.ini).

readDefaultFile = C:\ Program Files \ MySQL \ MySQL Server 5.7 \ my.inireadDefaultGroup = client

readDefaultFile=C:\Program Files\MySQL\MySQL Server 5.7\my.ini readDefaultGroup=client

现在打开连接应根据需要从my.ini中读取客户端部分.

Now opening connections should read the client section from that my.ini as required.

这篇关于如何在没有安装服务器的情况下为MySQL Workbench设置客户端配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆