Friday, November 17, 2017

dbext: sql not executed

Hello,

I'm having trouble getting `dbext` to work. I installed dbext_2500 from https://vim.sourceforge.io/scripts/script.php?script_id=356.

My vim version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Oct 5 2017 04:42:50)
MacOS X (unix) version
Included patches: 1-1175
Compiled by travis@Traviss-Mac-592.local
Huge version with MacVim GUI.

I have Mariadb (MySQL) running in a docker container. I can connect to, and work with this database with Sequel Pro (https://sequelpro.com/). I can do the same with my local mysql command line client.

In my vimrc I've put the following line:
let g:dbext_default_profile_mariadb_local='type=MYSQL:user=root:passwd=therealpassword:dbname=mydbname:host=127.0.0.1:port=3306'

I've done `:DBSetOption display_cmd_line=1`. When I execute SQL script in vim with this profile, e.g. by doing <leader>slt, I always get:

Connection: T(MYSQL) H(127.0.0.1) P(3306) D(mvne_local) U(root) at 11:49
Last command:
mysql -u root -ptherealpassword -h 127.0.0.1 -P 3306 -D mydbname -t < /var/folders/1p/wx9146md1_l6d204b6bhv_rm0000gn/T/vrGam1h/dbext.sql
Last SQL:
show tables like '%';
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql Ver 14.14 Distrib 5.7.19, for osx10.11 (x86_64) using EditLine wrapper
Copyright (c) 2000, 2017, 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.
Usage: mysql [OPTIONS] [database]
-?, --help Display this help and exit.
-I, --help Synonym for -?
[and the rest of the usage message from mysql...]

When I copy the cmd and execute it in bash I get the correct result:

>> mysql -u root -ptherealpassword -h 127.0.0.1 -P 3306 -D mydbname -t < /var/folders/1p/wx9146md1_l6d204b6bhv_rm0000gn/T/vrGam1h/dbext.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------------------------+
| Tables_in_mydbname (%) |
+--------------------------+
| contact |
| customer |
+--------------------------+

(You notice I've done this copy/paste thing a few times doing the tutorial).

So: everything "looks" fine, but it's just not coming through to the database...
Can anybody help?

Best regards,
Wietse

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment