todo-db
.
ls-966d5bf6be8ee5178432a633398bf4256bfcab69.cucxkvhp11zu.us-west-2.rds.amazonaws.com
LS_ENDPOINT
to hold the value of the endpoint of your database:
LS_ENDPOINT=$(pbpaste)
dbmasteruser
)
and the password (taskstasks
):
LS_USERNAME=dbmasteruser LS_PASSWORD=taskstasks
echo "Endpoint ="$LS_ENDPOINT echo "Username ="$LS_USERNAME echo "Password ="$LS_PASSWORD
cat /opt/bitnami/apache2/configs/config.php.bak | \ sed "s/<endpoint>/$LS_ENDPOINT/; \ s/<username>/$LS_USERNAME/; s/<password>/$LS_PASSWORD/;" \ >> /opt/bitnami/apache2/configs/config.php.lightsail_db
cat /opt/bitnami/apache2/configs/config.php.lightsail_db
cp /opt/bitnami/apache2/configs/config.php.lightsail_db /opt/bitnami/apache2/configs/config.php
cat /opt/bitnami/apache2/configs/config.php
install.php
script to configure the
database:
http://<IP-address>/install.php
http://<IP-address>
There should not be any tasks displayed.
Migrate the data out of your local MySQL database and into the Lightsail
database. This is accomplished using two command line utilities:
mysqldump
and mysql
. mysqldump
extracts the content from the local
database and pipes it into mysql
, which loads the input into the
Lightsail database.
mysqldump -u root \ --databases tasks \ --single-transaction \ --compress \ --order-by-primary \ -p$(cat /home/bitnami/bitnami_application_password) \ | mysql -u $LS_USERNAME \ --port=3306 \ --host=$LS_ENDPOINT \ -p$LS_PASSWORD
You will see two warnings regarding supplying a password via the command line. These warnings can safely be ignored, but note that, in production, you shouldn’t supply passwords via the command line, especially in scripts.