Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

AWS Lightsail Wordpress Managed MySQL Database mysqldump command not found

I am following the guide here: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-connect-wordpress-to-mysql-managed-database

On step 2.3 it asks me to type in the command:

mysqldump -u root --databases bitnami_wordpress --single-transaction --compress --order-by-primary -p$(cat /home/bitnami/bitnami_application_password) | mysql -u DbUserName --host DbEndpoint --password

(after swapping out the username and endpoint).

When I do this I get the response:

-bash: mysql: command not found
-bash: mysqldump: command not found

I found that the mysql and mysqldump commands are not on the path so I looked around and found them in /opt/bitnami/mysql/bin/

When I try to run them from there (or cd into that directory) I get:

-bash: /opt/bitnami/mysql/bin/mysql: Permission denied
-bash: /opt/bitnami/mysql/bin/mysqldump: Permission denied

I also tried assuming the role of root su root using the password in /home/bitnami/bitnami_application_password but that results in:

su: Authentication failure
question from:https://stackoverflow.com/questions/65854235/aws-lightsail-wordpress-managed-mysql-database-mysqldump-command-not-found

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This took me a while to figure out but I found the answer here: https://docs.bitnami.com/bch/how-to/troubleshoot-permission-issues/ at the bottom of the page. After I ran:

 sudo /opt/bitnami/use_wordpress

my bash environment was updated and I was able to run the original commands.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...