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

Problem pulling database #98

Closed
joeguilmette opened this issue Oct 9, 2014 · 4 comments
Closed

Problem pulling database #98

joeguilmette opened this issue Oct 9, 2014 · 4 comments

Comments

@joeguilmette
Copy link

So, everything will pull successfully via rsync except the database.

I'm using VVV via Vagrant/VirtualBox to get WordPress up. VVV uses Ubuntu/Nginx.
Upon initially running Wordmove, I get this error:

▬▬ ✓ Pulling Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    local | mysqldump --host=localhost --user=root --password=root masonry > /Users/joe/Code/vagrant-local/www/masonry/htdocs/wp-content/local-backup-1412822838.sql
sh: mysqldump: command not found
/Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:147:in `run': Return code reports an error (RuntimeError)
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:210:in `save_local_db'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/ssh.rb:32:in `pull_db'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:47:in `block in pull'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:34:in `block in handle_options'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `each'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `handle_options'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:46:in `pull'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
        from /usr/bin/wordmove:23:in `load'
        from /usr/bin/wordmove:23:in `<main>'

Ok... So then I brew install mysql, perhaps naively.

▬▬ ✓ Pulling Database ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    local | mysqldump --host=localhost --user=root --password=root masonry > /Users/joe/Code/vagrant-local/www/masonry/htdocs/wp-content/local-backup-1412822877.sql
Warning: Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
/Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:147:in `run': Return code reports an error (RuntimeError)
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/base.rb:210:in `save_local_db'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/deployer/ssh.rb:32:in `pull_db'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:47:in `block in pull'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:34:in `block in handle_options'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `each'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:32:in `handle_options'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/lib/wordmove/cli.rb:46:in `pull'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /Library/Ruby/Gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Library/Ruby/Gems/2.0.0/gems/wordmove-1.2.0/bin/wordmove:6:in `<top (required)>'
        from /usr/bin/wordmove:23:in `load'
        from /usr/bin/wordmove:23:in `<main>'

I've double checked the Movefile against wp-config.php to ensure that it's using the proper credentials. Here's what we have.

Movefile:

  database:
    name: "masonry"
    user: "root"
    password: "root"
    host: "localhost"

wp-config.php:

// ** MySQL settings ** //
/** The name of the database for WordPress */
define('DB_NAME', 'masonry');

/** MySQL database username */
define('DB_USER', 'root');

/** MySQL database password */
define('DB_PASSWORD', 'root');

/** MySQL hostname */
define('DB_HOST', 'localhost');

I have a feeling the issue is that wordmove can't figure out how to edit the Vagrant instance Nginx, but I haven't the faintest clue how to get there. Any ideas?

@endorama
Copy link
Contributor

endorama commented Oct 9, 2014

Hi :) You said that everything pull successfully, so I assume that files are correctly moved between Vagrant and your machine. If this is the case probably the problem is not related to Vagrant.

Moreover the error you are getting seems to be related to you local environment.

The first thing I'll try to understand where lays the problem is to check if you can login to your local mysql instance. Are you able to login to mysql from command line?
What is the output of this command ( on your machine )?

$ mysql -u root -proot

Another question: the wp-config.php you mentioned is the one from your local or remote Wordpress?

@joeguilmette
Copy link
Author

I think my issue is a fundamental misunderstanding of how Vagrant/VirtualBox works. I thought that Nginx on the VirtualBox would handle the sql db, right? Why would I need mysql running in my local OSX environment?

Sure enough, installing mysql and running $ mysql -u root -proot, I see that I have a password error. After fixing it, I come to see that mysql doesn't know anything about the referenced database.

So it seems that Wordmove is attempting to interact with my local install of mysql rather than Nginx on the VirtualBox. I have some good error messages and a good path to go down. I think I might be able to bang my head against the table a bit longer and figure this out. And if not, as you said, it looks like an issue with my OSX and Vagrant configuration, not Wordmove.

Thanks for helping me out!

@endorama
Copy link
Contributor

endorama commented Oct 9, 2014

:) No problem.

My guess is that what you want to achieve is using Vagrant as your local development environment with a remote production server on {put-your-hosting-here}.

If this is the case, just install Wordmove in the Vagrant machine ( and use it from there ), instead that on you laptop, and you should be ready to go! :) This way pulling the website would use nginx and mysql of the Vagrant box.

Good luck,
cheers

@joeguilmette
Copy link
Author

ah! the missing link.

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

2 participants