Closed markljackson closed 7 years ago
Most probably you have some kind of problem in SQLToolsConnections.sublime-settings
, could be invalid json ?
Can you post your entire connections json file?
I've redacted the password. It has a "0", and "!" in it; the rest are letters, two caps.
I've also tried "default": null, and "default": "bank"
{
"connections": {
"bank": {
"type" : "mysql",
"host" : "127.0.0.1",
"port" : 3306,
"database": "bank",
"username": "lrnsql",
// use of password for MySQL is not recommended (use "defaults-extra-file" or "login-path")
"password": "redacted", // you will get a security warning in the output
// "defaults-extra-file": "/path/to/defaults_file_with_password", // use [client] or [mysql] section
// "login-path": "your_login_path",
// login path in your ".mylogin.cnf"
"encoding": "utf-8"
},
// "default": "bank"
"default" : null
}
You have missing one closing }
bracket (3 open curly brackets and only 2 closing).
{
"connections": {
"bank": {
"type" : "mysql",
"host" : "127.0.0.1",
"port" : 3306,
"database": "bank",
"username": "lrnsql",
// use of password for MySQL is not recommended (use "defaults-extra-file" or "login-path")
"password": "redacted", // you will get a security warning in the output
// "defaults-extra-file": "/path/to/defaults_file_with_password", // use [client] or [mysql] section
// "login-path": "your_login_path",
// login path in your ".mylogin.cnf"
"encoding": "utf-8"
},
// "default": "bank"
"default" : null
}
}
Ok, I set that up correctly, but now I'm getting this:
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 797, in run_
return self.run()
File "/Users/-USERNAME-/Library/Application Support/Sublime Text 3/Packages/SQLTools/SQLTools.py", line 469, in run
ST.selectConnection(tablesCallback=lambda: Window().run_command('st_execute'))
File "/Users/-USERNAME-/Library/Application Support/Sublime Text 3/Packages/SQLTools/SQLTools.py", line 269, in selectConnection
ST.connectionList = getConnections()
File "/Users/-USERNAME-/Library/Application Support/Sublime Text 3/Packages/SQLTools/SQLTools.py", line 84, in getConnections
connectionsObj[name] = createConnection(name, config, settings=settings.all())
File "/Users/-USERNAME-/Library/Application Support/Sublime Text 3/Packages/SQLTools/SQLTools.py", line 101, in createConnection
newConnection = Connection(name, config, settings=settings)
File "/Users/-USERNAME-/Library/Application Support/Sublime Text 3/Packages/SQLTools/SQLToolsAPI/Connection.py", line 48, in __init__
self.type = options.get('type', None)
AttributeError: 'NoneType' object has no attribute 'get'
Do I need to specify the path to MYSQL? Or am I missing something else?
I tested again in SQLExec, and it's finding MYSQL, and running queries.
Mark, I was on mobile and couldn't test my suggestion. I made a mistake and put the brace in wrong place. I've double checked and this one should work for you:
{
"connections": {
"bank": {
"type" : "mysql",
"host" : "127.0.0.1",
"port" : 3306,
"database": "bank",
"username": "lrnsql",
// use of password for MySQL is not recommended (use "defaults-extra-file" or "login-path")
"password": "redacted", // you will get a security warning in the output
// "defaults-extra-file": "/path/to/defaults_file_with_password", // use [client] or [mysql] section
// "login-path": "your_login_path",
// login path in your ".mylogin.cnf"
"encoding": "utf-8"
}
},
"default" : null
}
Here is the same content, but more indented version, so you can see the structure more clearly.
{
"connections": {
"bank": {
"type" : "mysql",
"host" : "127.0.0.1",
"port" : 3306,
"database": "bank",
"username": "lrnsql",
// use of password for MySQL is not recommended (use "defaults-extra-file" or "login-path")
"password": "redacted", // you will get a security warning in the output
// "defaults-extra-file": "/path/to/defaults_file_with_password", // use [client] or [mysql] section
// "login-path": "your_login_path",
// login path in your ".mylogin.cnf"
"encoding": "utf-8"
}
},
"default" : null
}
That worked, thanks.
When I put in the new version, the color coding "looked right." I tried to modify the first version, and made it worse. lol.
Sublime Text is not my usual editor, and I'm not all that familiar with setting up it's plugins, or anything else for that matter.
Again, thanks for the help.
Issue Type
Prerequisites (For bugfixes)
Description
No matter how I try to activate SQLTools database commands, I get nothing. When I checked the console I found this:
I am able to bring up the settings panels, but not able to connect to the database, or run a query..
NOTE: I was able to set up SQLExec, and that works fine.
Steps to Reproduce (For bugfixes)
Expected behavior: [What you expected to happen]
I expected to be able to connect to mysql, and run a query.
Actual behavior: [What actually happened]
Nothing. I had to look in the console to see what was happening.
Versions