How can I set client configuration for MySQL Workbench without an installed server?

给你一囗甜甜゛ 提交于 2020-12-27 06:01:56

问题


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?

Update:

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';

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'"

回答1:


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.

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.ini readDefaultGroup=client

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




回答2:


MySQL Workbench doesn't load any server configuration file for its own configuration. It can work on such a config file for a server, however (server section, usually [mysqld] only).

MySQL Workbench's configuration is a manual step you have to do in order to connect to a server (be it local or remote).



来源:https://stackoverflow.com/questions/17598541/how-can-i-set-client-configuration-for-mysql-workbench-without-an-installed-serv

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!