sqlcrush icon indicating copy to clipboard operation
sqlcrush copied to clipboard

Opening a mysql db results in CRITICAL FAILURE

Open lukaszmoskwa opened this issue 6 years ago • 4 comments

This tool looks exactly what I need. However, I have tried several times to start a connection with a MySQL database and the operation always ends with CRITICAL FAILURE.

The command I'm running is the following

sqlcrush -t mysql -d my_db -u luke -p psw123

Instead of using the parameter -p I also tried -pd, as in the documentation is used for the password, while in the examples within the application is used -p

immagine

I also tried to change the parameters of the host and socket, but without any result.

lukaszmoskwa avatar Sep 30 '19 07:09 lukaszmoskwa

I've run into this problem as well. Per https://github.com/coffeeandscripts/sqlcrush/issues/7#issuecomment-414868090, you can change a few lines in the main sqlcrush Python script (around line 927) and then get an error message in your terminal.

I have done that, but still do not have things working. No matter what I give on the command line, the error message is along the lines of:

(pymysql.err.OperationalError) (1045, "Access denied for user 'username'@'dbserver' (using password: NO)")

So, at least in my case, the problem seem to be that I cannot seem to figure out how to get sqlcrush to authorize using the provided password.

As with @Lykos94 , I've tried both the '-p ' and '-p' (i.e., no empty space) variants, but that has not resolved the problem.

morsedl avatar Nov 12 '19 08:11 morsedl

I too tried to print the exception and, in general, to look inside the code for the problem that leads to the CRITICAL FAILURE in my case. Unfortunately, I was not able to get to the bottom of it because the code does not seem to me of immediate understanding and needs a more verbose documentation. Consequently, I opted for another solution: although recreating something that already exists instead of modifying and improving the code already present is counterproductive in the field of open source, I decided to create my own repo from scratch with a program that meets my needs. Although it has less functionality than sqlcrush and for the moment only supports MySQL, it works for what I need. If it would be useful to someone, I leave the link to it below:

https://github.com/Lykos94/dbcurses

lukaszmoskwa avatar Nov 12 '19 09:11 lukaszmoskwa

@Lykos94 Thanks, most helpful.

After a bit more hunting, I found SQL electron:

https://github.com/sqlectron/sqlectron-term

After trying 3-4 of these fullscreen console apps, this was the first that just worked. A package called mitzasql seemed pretty good, but my setup has a conflict with it, because we have to quote our database names in backticks and, if i do that, I cannot log in (as mitzasql in turn quotes it, so the backticks become a part of the login string, which fails).

At any rate, thanks again and just FYI.

morsedl avatar Nov 12 '19 10:11 morsedl

Thank you for pointing out sqlelectron-term, I didn't know that one and seems a really great app 👍

lukaszmoskwa avatar Nov 12 '19 12:11 lukaszmoskwa