用wsl设置无头wordpress启动包

dauxcl2d  于 2021-06-20  发布在  Mysql
关注(0)|答案(1)|浏览(359)

项目的github:https://github.com/postlight/headless-wp-starter
我试着用wsl在我的windows机器上设置无头启动工具包。但是当我运行yarn install命令时,我总是被卡住,它在终端中给了我以下错误。

`mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 [Exec]  Exit code 1  Time 0.571s
 [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 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
 [Exec]  Exit code 1  Time 0.566s
 [Exec] Running mysql -uroot -proot -h 0.0.0.0 -e "grant all privileges on wp_headless.* to wp_headless@localhost"

mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 [Exec]  Exit code 1  Time 0.557s
 [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 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

 [Exec]  Exit code 1  Time 0.623s
 [Exec] Running wp --allow-root core download --version=4.9.7 --locale=en_US --force in /mnt/c/projects/headless/wordpress

Downloading WordPress 4.9.7 (en_US)...
Using cached file '/home/efk/.wp-cli/cache/core/wordpress-4.9.7-en_US.tar.gz'...
Success: WordPress downloaded.

 [Exec] Done in 7.561s
 [Exec] Running rm wordpress/wp-config.php > /dev/null 2>&1 ||
 true
 [Exec] Done in 0.52s
 [Exec] Running wp --allow-root core config --dbname=wp_headless --dbuser=wp_headless --dbpass=wp_headless --dbhost=0.0.0.0 in /mnt/c/projects/headless/wordpress

ERROR 1045 (28000): Access denied for user 'wp_headless'@'localhost' (using password: YES)
 [Exec]  Exit code 1  Time 1.512s
 [Exec] Running wp --allow-root db drop --yes in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.797s

 [Exec] Running wp --allow-root db create in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.765s

 [Exec] Running wp --allow-root core install --url=localhost:8080 --title="Postlight Headless WP Starter" --admin_user="nedstark" --admin_password="winteriscoming" --admin_email="nedstark@headlesswpstarter.dev" --skip-email in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.775s

 [Exec] Running wp --allow-root theme activate postlight-headless-wp in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.778s

 [Exec] Running wp --allow-root theme delete twentyfourteen in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.782s

 [Exec] Running wp --allow-root theme delete twentyfifteen in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.771s

 [Exec] Running wp --allow-root theme delete twentysixteen in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 38.933s

 [Exec] Running wp --allow-root theme delete twentyseventeen in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.8s

 [Exec] Running wp --allow-root plugin delete akismet in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.766s

 [Exec] Running wp --allow-root plugin delete hello in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.784s

 [Exec] Running wp --allow-root 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 /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.753s

 [Exec] Running wp --allow-root acf sync in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.765s

 [Exec] Running wp --allow-root rewrite structure "/%year%/%monthnum%/%day%/%postname%/" in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.776s

 [Exec] Running wp --allow-root option update blogdescription "Just another (headless) WordPress site by your friends at Postlight" in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.745s

 [Exec] Running wp --allow-root post update 1 wp-content/themes/postlight-headless-wp/post-content/sample-post.txt --post_title="Sample Post" --post_name=sample-post in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.75s

 [Exec] Running wp --allow-root 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 /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.769s

 [Exec] Running wp --allow-root term update category 1 --name="Sample Category" in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.758s

 [Exec] Running wp --allow-root menu create "Header Menu" in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.78s

 [Exec] Running wp --allow-root menu item add-post header-menu 1 in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.769s

 [Exec] Running wp --allow-root menu item add-post header-menu 2 in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.782s

 [Exec] Running wp --allow-root menu item add-term header-menu category 1 in /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.902s

 [Exec] Running wp --allow-root 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 /mnt/c/projects/headless/wordpress
Error: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 0.819s

 [Exec] Running wp --allow-root menu location assign header-menu header-menu in /mnt/c/projects/headless/wordpress
Err

or: 'wp-config.php' not found.
Either create one manually or use `wp config create`.
 [Exec]  Exit code 1  Time 1.134s

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

Done in 101.52s.`

我试过你在自述中写的不同方法来修复它,但似乎没有任何帮助。我没有在我的电脑上mysql之前,我运行这个,所以它似乎wierd。
你们有什么线索吗?
windows安装指南是一个相当痛苦和难以理解的,因为它只是几个步骤,真正解释。
还有谁有这些问题并解决了?谢谢!

i7uq4tfw

i7uq4tfw1#

您可能需要运行一些升级。更具体地说,对我来说,修复就像运行一样简单 yarn upgrade . 这应该可以解决您的问题,因为wsl与旧包之间存在一些兼容性问题。

相关问题