Reputation: 75
So far I've tried this http://www.youtube.com/watch?v=tPd4m3PLVqU but with no luck. Here is what I tried. And I saved it to user packages in sublime text 2, followed by trying to run a select command with command B.
{
"cmd": ["mysql", "-u", "markrios", "-e", "source $file"],
"selector": "source.sql"
}
Also, I apologize in advance if this is a stupid question.
OSX 10.9.1. Sublime Text 2 Server version: 5.6.15 MySQL Community Server (GPL)
BTW, I'm currently using MySQL Workbench, but I'd like to use Sublime. The syntax highlighting is better within Sublime (in my opinion).
Any help would be appreciated! Thanks!
@ MattDMo
Update 1: 2/20/14 5:37 PM PST
after running use cisp;
in Sublime I get the following
[Errno 2] No such file or directory
[cmd: [u'mysql', u'-u', u'markrios', u'-e', u'source /Users/markrios/test.html']]
[dir: /Users/markrios]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
I'm also confused about how the sublime text build system knows what password to use for logging into mysql. As I login into the terminal with this command mysql -umarkrios -p
and then get this message
` Marks-MacBook-Air-2:~ markrios$ mysql -umarkrios -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.6.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. `
my goal is to get something like this in Sublime Text 2:
`mysql> select Holiday.* from Holiday;
+--------------------+------------+---------------+ | holiday | actualdate | celebratedate | +--------------------+------------+---------------+ | CHRISTMAS | 2012-12-25 | 2012-12-25 | | COLUMBUS DAY | 2012-10-08 | 2012-10-08 | | INDEPENDENCE DAY | 2012-07-04 | 2012-07-04 | | LABOR DAY | 2012-09-03 | 2012-09-03 | | MARTIN LUTHER KING | 2012-01-15 | 2012-01-16 | | MEMORIAL DAY | 2012-05-28 | 2012-05-28 | | NEW YEAR DAY | 2012-01-01 | 2012-01-02 | | PRESIDENTS DAY | 2012-02-20 | 2012-02-20 | | THANKSGIVING | 2012-11-22 | 2012-11-22 | | VETERANS DAY | 2012-11-11 | 2012-11-12 | +--------------------+------------+---------------+ 10 rows in set (0.01 sec)
mysql> `
Upvotes: 3
Views: 7124
Reputation: 471
Will using this plugin give you the results you need: https://github.com/jum4/sublime-sqlexec? You can load this from package control and I would argue it's much easier than messing with your own build. Hope this helps and Good luck!
Upvotes: 2