Last active
October 13, 2018 02:02
-
-
Save queirozsc/d04a9e48699ef3640be348a525c3ac91 to your computer and use it in GitHub Desktop.
[Manipulando LigthSail] Comunicando com instância AWS LightSail via SSH e SCP #aws #ligthsail #mysql #ssh #scp #wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change the permission of .pem certificate so only the root user can read it | |
chmod 400 LightsailDefaultPrivateKey-us-east-1.pem ; | |
cp LightsailDefaultPrivateKey-us-east-1.pem ~/.ssh ; | |
# Connect to LigthSail via SSH | |
ssh -i ~/.ssh/LightsailDefaultPrivateKey-us-east-1.pem bitnami@34.200.244.131 ; | |
# Send file LightSail via SCP | |
scp -i ~/.ssh/LightsailDefaultPrivateKey-us-east-1.pem backup-9.5.2018_09-40-41_gaiapole.tar.gz bitnami@34.200.244.131:~ ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -N -L 8888:127.0.0.1:80 -i ~/.ssh/LightsailDefaultPrivateKey-us-east-1.pem bitnami@34.200.244.131 ; | |
firefox http://127.0.0.1:8888/phpmyadmin ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP DATABASE IF EXISTS gaiapolewp; | |
CREATE DATABASE gaiapolewp; | |
USE gaiapolewp; | |
SHOW TABLES; | |
SELECT DATE(post_date), COUNT(1) FROM gp_posts WHERE DATE(post_date) >= '2018-08-01' GROUP BY DATE | |
(post_date); | |
SELECT DATE_FORMAT(post_date, '%Y-%m'), COUNT(1) FROM gp_posts GROUP BY DATE_FORMAT(post_date, '% | |
Y-%m'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysql -u root -p | |
mysql -p -u root gaiapolewp < gaiapolewp.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO wp_users SELECT * FROM gaiapolewp.gp_users; | |
INSERT INTO wp_usermeta SELECT * FROM gaiapolewp.gp_usermeta; | |
DELETE FROM wp_terms; | |
INSERT INTO wp_terms SELECT * FROM gaiapolewp.gp_terms; | |
DELETE FROM wp_term_relationships; | |
INSERT INTO wp_term_relationships SELECT * FROM gaiapolewp.gp_term_relationships; | |
DELETE FROM wp_term_taxonomy; | |
INSERT INTO wp_term_taxonomy SELECT * FROM gaiapolewp.gp_term_taxonomy; | |
DELETE FROM wp_posts; | |
INSERT INTO wp_posts | |
SELECT ID | |
, post_author | |
, post_date | |
, post_date | |
, post_content | |
, post_title | |
, post_excerpt | |
, post_status | |
, comment_status | |
, ping_status | |
, post_password | |
, post_name | |
, to_ping | |
, pinged | |
, post_modified | |
, post_modified | |
, post_content_filtered | |
, post_parent | |
, guid | |
, menu_order | |
, post_type | |
, post_mime_type | |
, comment_count | |
FROM gaiapolewp.gp_posts; | |
DELETE FROM wp_postmeta; | |
INSERT INTO wp_postmeta SELECT * FROM gaiapolewp.gp_postmeta; | |
DELETE FROM wp_comments; | |
INSERT INTO wp_comments SELECT * FROM gaiapolewp.gp_comments; | |
DELETE FROM wp_commentmeta; | |
INSERT INTO wp_commentmeta SELECT * FROM gaiapolewp.gp_commentmeta; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment