postlight / headless-wp-starter

🔪 WordPress + React Starter Kit: Spin up a WordPress-powered React app in one step
https://archive.postlight.com/labs/wordpress-react-starter-kit
GNU General Public License v2.0
4.47k stars 651 forks source link

SQL Issue on Install #96

Closed scottdevito closed 6 years ago

scottdevito commented 6 years ago

I'm running Ubuntu 18.04 and all I've done so far is complete the prerequisite installs for Linux and clone the repo. Everything seems fine with the front end but when I try to run sudo yarn install in the wordpress directory, I get a bunch of SQL related errors (starting at ERROR 1698 (28000): Access denied for user 'root'@'localhost').

When I start up the wordpress server it redirects me to the setup wizard for wp-config (http://localhost:8080/wp-admin/setup-config.php?step=0) and is never able to connect.

I've dug around for possible solutions, recloned, and retried but I keep getting the same issue. Any help would be greatly appreciated.


yarn install v1.7.0
$ chmod +x install.sh && chmod +x mysql_config.sh && ./install.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
php is already the newest version (1:7.2+60ubuntu1).
php-mysql is already the newest version (1:7.2+60ubuntu1).
mysql-client is already the newest version (5.7.22-0ubuntu18.04.1).
The following package was automatically installed and is no longer required:
  gconf2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
--2018-06-02 12:32:11--  https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.208.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.208.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4595436 (4.4M) [application/octet-stream]
Saving to: ‘wp-cli.phar’

wp-cli.phar                                   100%[===============================================================================================>]   4.38M  6.46MB/s    in 0.7s

2018-06-02 12:32:12 (6.46 MB/s) - ‘wp-cli.phar’ saved [4595436/4595436]

--2018-06-02 12:32:12--  http://robo.li/robo.phar
Resolving robo.li (robo.li)... 104.27.148.169, 104.27.149.169, 2400:cb00:2048:1::681b:94a9, ...
Connecting to robo.li (robo.li)|104.27.148.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://robo.li/robo.phar [following]
--2018-06-02 12:32:12--  https://robo.li/robo.phar
Connecting to robo.li (robo.li)|104.27.148.169|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2450431 (2.3M) [application/octet-stream]
Saving to: ‘robo.phar’

robo.phar                                     100%[===============================================================================================>]   2.34M  5.27MB/s    in 0.4s

2018-06-02 12:32:13 (5.27 MB/s) - ‘robo.phar’ saved [2450431/2450431]

[1/4] Resolving packages...
success Already up-to-date.
$ robo wordpress:setup

 This will replace your current WordPress install. Are you sure you want to do this? (yes/no) [no]:
 > y

?  Do you have an existing database you'd like to use and configure yourself? (y/n):  n
 [Exec] Running echo 'mysql-server mysql-server/root_password_again password root' | sudo debconf-set-selections
 [Exec] Done in 0.384s
 [Exec] Running echo 'mysql-server mysql-server/root_password_again password root' | sudo debconf-set-selections
 [Exec] Done in 0.354s
 [Exec] Running sudo apt-get -y install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (5.7.22-0ubuntu18.04.1).
The following package was automatically installed and is no longer required:
  gconf2
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
 [Exec] Done in 0.718s
 [Exec] Running sudo usermod -d /var/lib/mysql/ mysql
usermod: no changes
 [Exec] Done in 0.029s
 [Exec] Running sudo service mysql start
 [Exec] Done in 1.034s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'create user if not exists wp_headless'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
 [Exec]  Exit code 1  Time 0.026s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'create database if not exists wp_headless'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
 [Exec]  Exit code 1  Time 0.011s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e "grant all privileges on wp_headless.* to wp_headless@localhost identified by 'wp_headless'"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
 [Exec]  Exit code 1  Time 0.009s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'flush privileges'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
 [Exec]  Exit code 1  Time 0.012s
 [Exec] Running wp core download --version=4.9.5 --locale=en_US --force in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.124s
 [Exec] Running wp core config --dbname=wp_headless --dbuser=wp_headless --dbpass=wp_headless --dbhost=0.0.0.0 in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.102s
 [Exec] Running wp db drop --yes in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.09s
 [Exec] Running wp db create in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.101s
 [Exec] Running wp core install --url=localhost:8080 --title="Postlight Headless WP Starter" --admin_user="nedstark" --admin_password="winteriscoming" --admin_email="nedstark@headlesswpstarter.dev" --skip-email in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.138s
 [Exec] Running wp theme activate postlight-headless-wp in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.149s
 [Exec] Running wp theme delete twentyfourteen in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.146s
 [Exec] Running wp theme delete twentyfifteen in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.135s
 [Exec] Running wp theme delete twentysixteen in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.112s
 [Exec] Running wp theme delete twentyseventeen in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.136s
 [Exec] Running wp plugin delete akismet in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.108s
 [Exec] Running wp plugin delete hello in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.087s
 [Exec] Running wp plugin activate acf-to-wp-api advanced-custom-fields-pro akismet custom-post-type-ui wp-graphql wp-migrate-db-pro wp-migrate-db-pro-cli wp-migrate-db-pro-media-files wp-rest-api-v2-menus in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.125s
 [Exec] Running wp acf sync in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.126s
 [Exec] Running wp rewrite structure "/%year%/%monthnum%/%day%/%postname%/" in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.121s
 [Exec] Running wp option update blogdescription "Just another (headless) WordPress site by your friends at Postlight" in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.11s
 [Exec] Running wp post update 1 wp-content/themes/postlight-headless-wp/post-content/sample-post.txt --post_title="Sample Post" --post_name=sample-post in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.108s
 [Exec] Running wp post create wp-content/themes/postlight-headless-wp/post-content/welcome.txt --post_type=page --post_status=publish --post_name=welcome --post_title="Congratulations!" in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.118s
 [Exec] Running wp term update category 1 --name="Sample Category" in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.117s
 [Exec] Running wp menu create "Header Menu" in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.105s
 [Exec] Running wp menu item add-post header-menu 1 in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.102s
 [Exec] Running wp menu item add-post header-menu 2 in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.099s
 [Exec] Running wp menu item add-term header-menu category 1 in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.092s
 [Exec] Running wp menu item add-custom header-menu "Read about the Starter Kit on Medium" https://trackchanges.postlight.com/introducing-postlights-wordpress-react-starter-kit-a61e2633c48c in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.09s
 [Exec] Running wp menu location assign header-menu header-menu in /home/scott/code/github/storm-lax-academy/wordpress
Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.

If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.

If you'd like to continue as root, please run this again, adding this flag:  --allow-root

If you'd like to run it as the user that this site is under, you can run the following to become the respective user:

    sudo -u USER -i -- wp <command>

 [Exec]  Exit code 1  Time 0.088s

 [OK] Great. You can now log into WordPress at: http://localhost:8080/wp-admin (nedstark/winteriscoming)

Done in 12.21s. 
matopher commented 6 years ago

I'm having the same issue on OSX. I keep running into this error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Any help would be amazing.

yarn install v1.6.0
(node:83068) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
$ chmod +x install.sh && chmod +x mysql_config.sh && ./install.sh
Warning: wp-cli 1.5.1 is already installed and up-to-date
To reinstall 1.5.1, run `brew reinstall wp-cli`
Warning: wget 1.19.5 is already installed and up-to-date
To reinstall 1.19.5, run `brew reinstall wget`
--2018-06-02 14:03:02--  http://robo.li/robo.phar
Resolving robo.li (robo.li)... 104.27.148.169, 104.27.149.169
Connecting to robo.li (robo.li)|104.27.148.169|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://robo.li/robo.phar [following]
--2018-06-02 14:03:02--  https://robo.li/robo.phar
Connecting to robo.li (robo.li)|104.27.148.169|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2450431 (2.3M) [application/octet-stream]
Saving to: ‘robo.phar’

robo.phar                100%[=================================>]   2.34M  1.34MB/s    in 1.7s

2018-06-02 14:03:04 (1.34 MB/s) - ‘robo.phar’ saved [2450431/2450431]

[1/4] 🔍  Resolving packages...
success Already up-to-date.
$ robo wordpress:setup

 This will replace your current WordPress install. Are you sure you want to do this? (yes/no) [no]:
 > yes

?  Do you have an existing database you'd like to use and configure yourself? (y/n):  n
 [Exec] Running brew install mysql
Warning: mysql 5.7.22 is already installed and up-to-date
To reinstall 5.7.22, run `brew reinstall mysql`
 [Exec] Done in 2.367s
 [Exec] Running mysql.server start
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Matts-MacBook-Pro.local.pid).
 [Exec]  Exit code 1  Time 2.051s
 [Exec] Running ./mysql_config.sh
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
 [Exec] Done in 0.027s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'create user if not exists wp_headless'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 29 (HY000) at line 1: File './mysql/user.MYD' not found (Errcode: 2 - No such file or directory)
 [Exec]  Exit code 1  Time 0.051s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'create database if not exists wp_headless'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1006 (HY000) at line 1: Can't create database 'wp_headless' (errno: 124582280)
 [Exec]  Exit code 1  Time 0.056s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e "grant all privileges on wp_headless.* to wp_headless@localhost identified by 'wp_headless'"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 29 (HY000) at line 1: File './mysql/user.MYD' not found (Errcode: 2 - No such file or directory)
 [Exec]  Exit code 1  Time 0.049s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e 'flush privileges'
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 29 (HY000) at line 1: File './mysql/user.MYD' not found (Errcode: 2 - No such file or directory)
 [Exec]  Exit code 1  Time 0.051s
 [Exec] Running wp core download --version=4.9.5 --locale=en_US --force in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Downloading WordPress 4.9.5 (en_US)...
Using cached file '/Users/matt/.wp-cli/cache/core/wordpress-4.9.5-en_US.tar.gz'...
Success: WordPress downloaded.
 [Exec] Done in 4.661s
 [Exec] Running wp core config --dbname=wp_headless --dbuser=wp_headless --dbpass=wp_headless --dbhost=0.0.0.0 in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: The 'wp-config.php' file already exists.
 [Exec]  Exit code 1  Time 0.329s
 [Exec] Running wp db drop --yes in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
ERROR 1008 (HY000) at line 1: Can't drop database 'wp_headless'; database doesn't exist
 [Exec]  Exit code 1  Time 0.399s
 [Exec] Running wp db create in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
ERROR 1006 (HY000) at line 1: Can't create database 'wp_headless' (errno: 124582280)
 [Exec]  Exit code 1  Time 0.326s
 [Exec] Running wp core install --url=localhost:8080 --title="Postlight Headless WP Starter" --admin_user="nedstark" --admin_password="winteriscoming" --admin_email="nedstark@headlesswpstarter.dev" --skip-email in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.493s
 [Exec] Running wp theme activate postlight-headless-wp in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.465s
 [Exec] Running wp theme delete twentyfourteen in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.459s
 [Exec] Running wp theme delete twentyfifteen in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.506s
 [Exec] Running wp theme delete twentysixteen in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.48s
 [Exec] Running wp theme delete twentyseventeen in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.489s
 [Exec] Running wp plugin delete akismet in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.488s
 [Exec] Running wp plugin delete hello in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.486s
 [Exec] Running wp plugin activate acf-to-wp-api advanced-custom-fields-pro akismet custom-post-type-ui wp-graphql wp-migrate-db-pro wp-migrate-db-pro-cli wp-migrate-db-pro-media-files wp-rest-api-v2-menus in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.455s
 [Exec] Running wp acf sync in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.492s
 [Exec] Running wp rewrite structure "/%year%/%monthnum%/%day%/%postname%/" in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.509s
 [Exec] Running wp option update blogdescription "Just another (headless) WordPress site by your friends at Postlight" in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.461s
 [Exec] Running wp post update 1 wp-content/themes/postlight-headless-wp/post-content/sample-post.txt --post_title="Sample Post" --post_name=sample-post in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.498s
 [Exec] Running wp post create wp-content/themes/postlight-headless-wp/post-content/welcome.txt --post_type=page --post_status=publish --post_name=welcome --post_title="Congratulations!" in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.48s
 [Exec] Running wp term update category 1 --name="Sample Category" in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.483s
 [Exec] Running wp menu create "Header Menu" in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.472s
 [Exec] Running wp menu item add-post header-menu 1 in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.485s
 [Exec] Running wp menu item add-post header-menu 2 in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.502s
 [Exec] Running wp menu item add-term header-menu category 1 in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.482s
 [Exec] Running wp menu item add-custom header-menu "Read about the Starter Kit on Medium" https://trackchanges.postlight.com/introducing-postlights-wordpress-react-starter-kit-a61e2633c48c in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.513s
 [Exec] Running wp menu location assign header-menu header-menu in /Users/matt/code/lut-headless-wordpress/headless-wp-starter/wordpress
Error: Can’t select database. We were able to connect to the database server (which means your username and password is okay) but not able to select the `wp_headless` database.
 [Exec]  Exit code 1  Time 0.498s

 [OK] Great. You can now log into WordPress at: http://localhost:8080/wp-admin
      (nedstark/winteriscoming)
matopher commented 6 years ago

I found a fix for my issue with MySQL on OSX using Homebrew. I ended up using the instructions in this useful post to remove all traces of older MySQL installations and reinstall a fresh version. That seemed to do the trick.

@scottdevito — Maybe finding an equivalent set of commands for Linux would fix your problem too? It might be worth a shot.

ThatKDB commented 6 years ago

@scottdevito I was having this problem when trying to install on Ubuntu in Windows 10 WSL. I was able to solve it by assigning a password to the mysql root account.

scottdevito commented 6 years ago

@ThatKDB @matopher Thanks for the suggestions. I'll give them a try later today and report back.

glrodasz commented 6 years ago

If you are still having this error recently this could be the answer: https://github.com/postlight/headless-wp-starter/issues/94#issuecomment-397891514

scottdevito commented 6 years ago

@glrodasz that did the trick! Thanks for the help all.