dbext: unable to connect to MySQL database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

dbext: unable to connect to MySQL database

Stevan Earl
Hi Folks,

I have been using dbext with my Postgres databases for quite some time and really love it. Unfortunately, I have not been able to successfully connect dbext to my MySQL databases. dbext + Postgres works just fine so I know (well, assume) that the plugin and environment are working properly.

My MySQL connection looks like the following but I have tried every combination that I can think of: with and without passwd, -t, port, dbname.

let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'

When I execute a query, the return looks similar to the mysql man page along with my connection parameters that appear correct. I get a similar result even if I type in the connection parameters manually in the dbext dialog box. The connection parameters work fine when connecting from the shell so I know those also are not (or should not be) the problem.

Any ideas? Thanks in advance for your assistance.


Stevan

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

David Fishburn-2


On Tue, May 1, 2018 at 1:38 PM, Stevan Earl <[hidden email]> wrote:
....
 
My MySQL connection looks like the following but I have tried every combination that I can think of: with and without passwd, -t, port, dbname.

let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'

When I execute a query, the return looks similar to the mysql man page along with my connection parameters that appear correct. I get a similar result even if I type in the connection parameters manually in the dbext dialog box. The connection parameters work fine when connecting from the shell so I know those also are not (or should not be) the problem.



Can you supply a mysql command line call that correctly connects to the database.
If we start with something that works outside of Vim, then we can come up with the correct dbext connection string.

I assume that this is all running on the same machine that Vim is running on, given the host=localhost.

David


--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

Stevan Earl
In reply to this post by Stevan Earl
On Tuesday, May 1, 2018 at 10:38:14 AM UTC-7, Stevan Earl wrote:

> Hi Folks,
>
> I have been using dbext with my Postgres databases for quite some time and really love it. Unfortunately, I have not been able to successfully connect dbext to my MySQL databases. dbext + Postgres works just fine so I know (well, assume) that the plugin and environment are working properly.
>
> My MySQL connection looks like the following but I have tried every combination that I can think of: with and without passwd, -t, port, dbname.
>
> let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'
>
> When I execute a query, the return looks similar to the mysql man page along with my connection parameters that appear correct. I get a similar result even if I type in the connection parameters manually in the dbext dialog box. The connection parameters work fine when connecting from the shell so I know those also are not (or should not be) the problem.
>
> Any ideas? Thanks in advance for your assistance.
>
>
> Stevan
Hi David,

Thanks very much for responding. Yep, all on the same machine, and I see the exact same behavior regardless of whether I am attempting to query my localhost or a remote server.

No problems outside of Vim: queries work fine via CLI or a client such as MySQL Workbench.


Stevan

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

David Fishburn-2

Thanks very much for responding. Yep, all on the same machine, and I see the exact same behavior regardless of whether I am attempting to query my localhost or a remote server.

No problems outside of Vim: queries work fine via CLI or a client such as MySQL Workbench.


> Can you supply a mysql command line call that correctly connects to the database.  

You did not provide this information, just omit the password.

David



--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

Stevan Earl
On Wednesday, May 2, 2018 at 12:06:43 PM UTC-7, David Fishburn wrote:

> Thanks very much for responding. Yep, all on the same machine, and I see the exact same behavior regardless of whether I am attempting to query my localhost or a remote server.
>
>
>
> No problems outside of Vim: queries work fine via CLI or a client such as MySQL Workbench.
>
>
>
>
>
>
>
>
>
>
> > Can you supply a mysql command line call that correctly connects to the database.  
>
>
>
> You did not provide this information, just omit the password.
>
>
> David
Hi David,

Sure.

Here are a couple of different CLI approaches, both on localhost. Both of these return the expected result.

mysql -h localhost -u myusername -p
select * from lter10_arthropods_production.sites;

mysql -h localhost -u myusername -p -D lter10_arthropods_production
select * from sites;

I have a similar config in my vimrc for for the MySQL localhost, here trying naming the database explicitly and not doing so. Also tried with and without passing a password.

let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'

let g:dbext_default_profile_mysql_local_arthropods = 'type=MYSQL:host=localhost:port=3306:user=myusername:dbname=lter10_arthropods_production'

With either connection setting, running the above query with or without identifying the database name, I get the same result: man page details of MySQL, connection settings, and the query. I have attached a truncated version.


Thanks for your help.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

dbext.output (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

Wolf Bogacz
localhost is, as always, an alias to a specific IP address.

Most connection strings can be also provided with the IP address stated.

Can this be as simple as an IPv4/IPv6 mismatch, say dbext collects and uses the one, but requires the other?


On Wed, May 2, 2018 at 6:38 PM, Stevan Earl <[hidden email]> wrote:
On Wednesday, May 2, 2018 at 12:06:43 PM UTC-7, David Fishburn wrote:
> Thanks very much for responding. Yep, all on the same machine, and I see the exact same behavior regardless of whether I am attempting to query my localhost or a remote server.
>
>
>
> No problems outside of Vim: queries work fine via CLI or a client such as MySQL Workbench.
>
>
>
>
>
>
>
>
>
>
> > Can you supply a mysql command line call that correctly connects to the database.  
>
>
>
> You did not provide this information, just omit the password.
>
>
> David

Hi David,

Sure.

Here are a couple of different CLI approaches, both on localhost. Both of these return the expected result.

mysql -h localhost -u myusername -p
select * from lter10_arthropods_production.sites;

mysql -h localhost -u myusername -p -D lter10_arthropods_production
select * from sites;

I have a similar config in my vimrc for for the MySQL localhost, here trying naming the database explicitly and not doing so. Also tried with and without passing a password.

let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'

let g:dbext_default_profile_mysql_local_arthropods = 'type=MYSQL:host=localhost:port=3306:user=myusername:dbname=lter10_arthropods_production'

With either connection setting, running the above query with or without identifying the database name, I get the same result: man page details of MySQL, connection settings, and the query. I have attached a truncated version.


Thanks for your help.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: dbext: unable to connect to MySQL database

David Fishburn-2
In reply to this post by Stevan Earl
...
mysql -h localhost -u myusername -p
select * from lter10_arthropods_production.sites;

mysql -h localhost -u myusername -p -D lter10_arthropods_production
select * from sites;

I have a similar config in my vimrc for for the MySQL localhost, here trying naming the database explicitly and not doing so. Also tried with and without passing a password.

let g:dbext_default_profile_mysql_local = 'type=MYSQL:host=localhost:port=3306:user=myusername'

let g:dbext_default_profile_mysql_local_arthropods = 'type=MYSQL:host=localhost:port=3306:user=myusername:dbname=lter10_arthropods_production'

With either connection setting, running the above query with or without identifying the database name, I get the same result: man page details of MySQL, connection settings, and the query. I have attached a truncated version.


You can run:
:DBSetOption display_cmd_line=1
:DBSetOption delete_temp_file=0

Then execute your statement to see the command line dbext is executing.
Then you can cut and paste that command line into a terminal / command prompt and see what happens when you execute the exact same command outside of Vim.

If you do get an error executing the command, fiddle the command until it works outside of Vim, then we can figure out how to tweak the profile in dbext.

David

 

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.