Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password required on remote mysqldymp #665

Open
dompl opened this issue Feb 14, 2023 · 7 comments
Open

Password required on remote mysqldymp #665

dompl opened this issue Feb 14, 2023 · 7 comments

Comments

@dompl
Copy link

dompl commented Feb 14, 2023

Hi there.

I stared experiencing strange behaviour on some of my websites.

To push the website to the server I am using SSH with key. All files and going through smoothly but when it comes to mysqldump is prompting for server password.

▬▬ Pushing Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
remote | mysqldump --host=[secret] --port=3306 --user=BD_USER --password=DB_PASSWORD --result-file="[secret]/wp-content/dump.sql" DB_NAME
server@SERVER IP's password:

Anyone has an idea what could cause it?

@themkvz
Copy link

themkvz commented Apr 20, 2023

Hi!

I have the same issue, but it happened not on all servers, I don't know what the difference is between servers. These servers look very similar.
Pull/Push via ssh works fine for anything, except the database

Any ideas?

@themkvz
Copy link

themkvz commented Apr 21, 2023

@alessandro-fazzi @maiorano84 for visibility ^

I found only one distinction between servers, it is a version of ubuntu (22.04 vs 20.04)

Also, I tried to add ssh keys to a keychain and used different keys. Very strange why it is working on one the server but doesn't work on another one

@maiorano84
Copy link
Contributor

Hmmm.... never seen this one before. When connecting remotely, are you connecting as a manually created user? Or root?

I do know that attempting to connect as root without sudo on Ubuntu 22 with MySQL / MariaDb after using mysql_secure_installation will fail (root users are pretty locked down nowadays), and I don't think Wordmove attempts to do anything with sudo access. I could be mistaken on that, though.

@themkvz
Copy link

themkvz commented Apr 24, 2023

@maiorano84 Thanks for your response.
I have two vps that installed the same CP (hestiacp) and the same settings (also regular user, not root), but only one difference in the Ubuntu version.
On 22.04 I get a password prompt when I try pull/push DB

@maiorano84
Copy link
Contributor

@themkvz Only other thing I can think of to try is to run the mysqldump utility with all of the parameters filled in directly on the server. If after running it manually you're still getting a password prompt, then it has more to do with the installation of your MySQL server than Wordmove itself.

Using the original ticket's remote output as a template, the steps would look something like the following:

  1. ssh yoursshuser@yourdomain.com
  2. mysqldump --host=<host goes here> --port=<port goes here> --user=<mysql user goes here> --password=<mysql password goes here> --result-file="<path/to/dump.sql>" <database name goes here>

If the remote command can be run directly on the server but not over SSH, then we may need to look into adding some logging behaviors to make sure everything is being handled and escaped as expected.

@themkvz
Copy link

themkvz commented May 4, 2023

@maiorano84 Sorry for the late response and many blurs)

I was able to create a dump.sql file without requiring any additional password after successfully connecting to the remote server and running the following command.
mysqldump --host=localhost --port=3306 --user=user --password=pwd --result-file="./dump.sql" db_name
SCR-20230504-rptd

@maiorano84
Copy link
Contributor

@alessandro-fazzi

We may want to flag this as a potential bug here for further investigation. This appears to be related to Ubuntu 22.04 and also possibly mysql_secure_installation.

I'll see if I can find some time to replicate the issue. I haven't looked at the codebase in a long time, but we may need to employ further debugging and logging options. Not sure if this is environment-related, or some edge case that Wordmove hasn't accounted for yet.

@themkvz

For reference purposes, can you provide a copy of your movefile (sensitive information redacted of course) along with a brief summary of your server environment (ie: OS, Version, Database Type, Database Version, etc.)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants