[TxMt] Remote host mysql database connection problem
Ciarán Walsh
ciawal at gmail.com
Tue Oct 30 16:34:37 UTC 2007
On 28 Oct 2007, at 04:03, Alain Couchot wrote:
>
> When I try to connect with TM I get a message : Unknown system
> variable ''
> coming from mysql server.
Hi Alain,
That’s odd – looks like your server doesn’t have an encoding
set. I’ve modified the SQL bundle to handle this gracefully, so you
have the following options:
• If you are already using an SVN checkout of the bundle just update
it
• If you’re not then check the manual under “Getting New
Bundles” for information on how to get it
• You can use this patch to fix the problem:
======================
Index: db_browser_lib.rb
===================================================================
--- db_browser_lib.rb (revision 8375)
+++ db_browser_lib.rb (working copy)
@@ -55,11 +55,7 @@
def get_mysql(database = nil)
unless @@connector
@@connector = Mysql::new(@settings.host, @settings.user,
@settings.password, database || @settings.name, @settings.port)
- begin
- encoding = @@connector.query('SELECT
@@character_set_database AS server').fetch_hash
- rescue
- encoding = {:server => 'utf8'}
- end
+ encoding = @@connector.query('SELECT @@character_set_database
AS server').fetch_hash
@@connector.query('SET NAMES utf8;') if encoding["server"] !=
'latin1'
end
@@connector
======================
Apply it in /Applications/TextMate.app/Contents/SharedSupport/Bundles/
SQL.tmbundle/Support/bin/
Or of course you can just wait for the next TextMate update, when
you’ll get it automatically.
Ciarán
More information about the textmate
mailing list