问题
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