Closed scottdevito closed 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)
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.
@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.
@ThatKDB @matopher Thanks for the suggestions. I'll give them a try later today and report back.
If you are still having this error recently this could be the answer: https://github.com/postlight/headless-wp-starter/issues/94#issuecomment-397891514
@glrodasz that did the trick! Thanks for the help all.
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 atERROR 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.