Support for Sailed.io and LocalWP

Hi,

I am trying to get sailed (a CLI tool that generates a Wordpress site and deploys it to hosting) to work with Local WP. The issue is as follows.

  • Local WP sets MYSQL User/Pass to be root/root, for the database ‘local’
  • Sailed sets MYSQL User/Pass to be wordpress/[very long string] for the database, ‘wordpress’

These tools both override wp-config.php.

The solution that came to me was to do this (as a note - do not execute this code for anyone reading).

  1. Update the User/Pass for local
use mysql;
update user set user='wordpress' where user='root';
update user set authentication_string=PASSWORD('[very long string]') where user='wordpress';
flush privileges;
  1. Update the MYSQL my.cnf.hbs config for local
user = wordpress
password = [very long string]
  1. Import the database local.sql to the sailed version using
wp db import path/to/local.sql

The issue is, the first command does not work, saying there is a line error, which then logs me out of MySQL, and I can’t then log back in using the new or old credentials. The SQL import doesn’t work either. I get this error.

Error: Import file missing or not readable: 
path/to/app/sql/local.sql

Do you know where I am going wrong?

I keep meaning to check out Sail since I learned about it on Konstantin’s blog.

It looks like in the Sailed.io documentation, there’s a specific doc on using Sail with Local. In your case, I think the missing piece is to follow the instructions of the Dual wp-config.php section.

Those instructions basically have you:

  1. Copy Local’s wp-config to a new file.
  2. Force install Sail.
  3. Update the Sail wp-config to include code to use Local’s configuration:
<?php
// Load local development configuration file
if ( file_exists( __DIR__ . '/.wp-config.local.php' ) ) {
    require_once( __DIR__ . '/.wp-config.local.php' );
    return;
}

// Production config below this line

Let us know if that gets you what you need!

1 Like

Thank you - this worked for me.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.