mtxr / SublimeText-SQLTools

SQLTools for Sublime Text 3
https://code.mteixeira.dev/SublimeText-SQLTools/
GNU General Public License v3.0
177 stars 40 forks source link

The database name, is twice in the query. #87

Closed marcoas closed 7 years ago

marcoas commented 7 years ago

I'm testing with v0.8.1 for first time ever, with this plugin, in Windows10, using MySql

I have a problem with some commands. ( For example: in Table Description or Show Table Records ) The database name, is twice in the query.

My Console, for example, looks like:

Warning: Using a password on the command line interface can be insecure. ERROR 1146 (42S02) at line 1: Table _myDatabaseName._myDatabaseName._myTable' doesn't exist

My connection settings looks like

    "Connection MySQL": {
        "type"    : "mysql",
        "host"    : "127.0.0.1",
        "port"    : 3306,
        "username": "root",
        "password": "_my_pass_",
        "database": "_myDatabaseName",
        "encoding": "utf-8"
    },

But if I write a SQL sentence and Execute, all work like a charm.

Note: How avoid that password warning message ???

tkopets commented 7 years ago

Thanks for reporting this bug! The issue with Table Description and Show Table Records is recently introduced - I'll fix in next few days. Regarding mysql warning message - passing a password in command line is indeed not very secure (this is how SQLTools currently passes the password). However, there are few alternative ways to supply the password for MySQL which are already implemented (but not released yet). So the suggestion is to try out new ways to supply password for connection, once this feature is released.

tkopets commented 7 years ago

The issue should be fixed in new release (v0.8.3). Also in this release, you will find alternative (better) ways to supply a password for MySQL connections. See release notes and MySQL manual. Let me know if Table Description and Show Table Records works for you as well as new ways to set a password for MySQL connection.

marcoas commented 7 years ago

Bug Fixed ! EXCELLENT and Thanks

Note for Password ... In connection Settings, with

defaults-extra-file='/path/to/fileOptions'

work great, if fileOptions look like:

[client]
password=_MY_PASS_

But this work too : Set variable Environment MYSQL_PWD and no set password or defaults-extra-file in connection setting