kristijanhusak / vim-dadbod-ui

Simple UI for https://github.com/tpope/vim-dadbod
MIT License
1.54k stars 94 forks source link

How to use query param like vim-dadbod in this plugins? #103

Closed sheenazien8 closed 3 years ago

sheenazien8 commented 3 years ago

I found error Error connecting to db Homestead: DB exec error: mysql: [Warning] Using a pass word on the command line interface can be insecure.^@ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.10.10' (111)

kristijanhusak commented 3 years ago

Is your vim-dadbod working fine?

Try this:

:DB your_db_url_here select * from some_table
sheenazien8 commented 3 years ago

working fine when i use this. :DB mysql:--login-path=homestead use lakasir; select * from users; but when i use DB mysql://homestead:secret@192.168.10.10:3360/lakasir select * from users; i found errors

kristijanhusak commented 3 years ago

try doing localhost instead of the ip.

sheenazien8 commented 3 years ago

in this case i want connect mysql in my vagrant / VM

kristijanhusak commented 3 years ago

Try connecting without the password:

DB mysql://homestead@192.168.10.10:3360/lakasir select * from users;

It should prompt you to enter the password.

sheenazien8 commented 3 years ago

i found this errors Screenshot from 2021-07-23 16-36-29

kristijanhusak commented 3 years ago

Your vagrant ip seems wrong.

sheenazien8 commented 3 years ago

in Vim-dadbod i can connect with query params, but when i wanna use vim-dadbod-ui i can't connect with query parmas

sheenazien8 commented 3 years ago

Your vagrant ip seems wrong.

No. because i can connect with this command DB mysql:--login-path=homestead use lakasir; select * from users;

kristijanhusak commented 3 years ago

Try defining your connection url like that and see if it works: mysql:--login-path=homestead use lakasir;

sheenazien8 commented 3 years ago

when i add new connection, and access the new connection, i got this errors Screenshot from 2021-07-23 16-50-39

and i try check in this file ~/.local/share/db_ui/connections.json my new connection is created like this

    {
        "url": "mysql:///--login-path%3Dhomestead",
        "name": "Homestead"
    }
kristijanhusak commented 3 years ago

I'll open upstream issue. I'm using dadbod's function that converts it to this.

kristijanhusak commented 3 years ago

Does your query work when you do this?

DB mysql:///--login-path%3Dhomestead select * from users
sheenazien8 commented 3 years ago

error, but it tries to connect to localhost instead of vagrant, ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

kristijanhusak commented 3 years ago

Does same thing happens with this?

DB mysql:///--login-path%3Dhomestead use lakasir;select * from users
sheenazien8 commented 3 years ago

it works!

sheenazien8 commented 3 years ago

but why when i use DBUI it didnt works

kristijanhusak commented 3 years ago

I'm not sure if it will work, but try adding your connection with the use lakasir part:

mysql:///--login-path%3Dhomestead use lakasir;

It would be best to just figure out the proper connection url. Can you also try adding this as connection?

mysql://homestead@192.168.10.10:3360/lakasir?login-path=homestead
sheenazien8 commented 3 years ago

mysql:///--login-path%3Dhomestead use lakasir; error acces denied

mysql://homestead@192.168.10.10:3360/lakasir?login-path=homestead error can't connect to MySQL server 192.168.10.10

kristijanhusak commented 3 years ago

From what I see in the docs here Your url should be something like this (if you didn't change any defaults):

mysql://homestead:secret@127.0.0.1:33060/lakasir
sheenazien8 commented 3 years ago

i got still same error

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10
kristijanhusak commented 3 years ago

I suggest figuring out the ip of the vagrant machine and apply that to the example from my previous comment. You can figure out the ip with this (haven't tried): https://stackoverflow.com/a/41251906/1474465

Than just use the ip in here:

mysql://homestead:secret@IP_HERE:33060/lakasir
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.