-->
BLANTERWISDOM101

Command line AWSCLI diterminal

Sunday, November 11, 2018

 

Download from S3 to EC2



root@ip-172-31-17-173:/var/www/html# aws s3 ls s3://bucketguwe 2018-11-10 23:59:59 4229012 wp_ujijayatrans2.sql in auto modeo modes) in auto mode 2018-11-11 00:00:00 286352916 wpujijayatransbe.zip ###################################################################.] root@ip-172-31-17-173:/var/www/html# ls coffee coffee.zip get-pip.py test.php root@ip-172-31-17-173:/var/www/html# aws s3 cp s3://bucketguwe/wpujijayatransbe.zip wpujijayatransbe.zip download: s3://bucketguwe/wpujijayatransbe.zip to ./wpujijayatransbe.zip root@ip-172-31-17-173:/var/www/html# aws s3 cp s3://bucketguwe/wp_ujijayatrans2.sql wp_ujijayatrans2.sql download: s3://bucketguwe/wp_ujijayatrans2.sql to ./wp_ujijayatrans2.sql root@ip-172-31-17-173:/var/www/html# 

input mysql, user root, passku admin123



root@ip-172-31-17-173:/var/www/html# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 51
Server version: 5.7.24-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 



Membuat database

mysql> create database wp_ujijayatrans2;
Query OK, 1 row affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| wp_ujijayatrans2   |
+--------------------+
5 rows in set (0.00 sec)


Pilih database

mysql> use wp_ujijayatrans2;
Database changed



Import from file sql

root@ip-172-31-17-173:/var/www/html# mysql -u root -p wp_ujijayatrans2 < wp_ujijayatrans2.sql
Enter password:

root@ip-172-31-17-173:/var/www/html# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.7.24-0ubuntu0.16.04.1 (Ubuntu)



mysql> select * from wp_options where option_id='1' or option_id='2'; +-----------+-------------+----------------------------------------+----------+ 
| option_id | option_name | option_value | autoload | +-----------+-------------+----------------------------------------+----------+ 
| 1 | siteurl | http://52.38.130.138/wpujijayatransbe/ | yes | 
| 2 | home | http://52.38.130.138/wpujijayatransbe/ | yes | +-----------+-------------+----------------------------------------+----------+ 
2 rows in set (0.00 sec) mysql> Connection to ec2-52-38-130-138.us-west-2.compute.amazonaws.com closed by remote host. Connection to ec2-52-38-130-138.us-west-2.compute.amazonaws.com closed. PS C:\Users\taufikmas\Downloads> 

root@ip-172-31-17-173:/etc/init.d# sudo /etc/init.d/mysql start
[ ok ] Starting mysql (via systemctl): mysql.service.


root@ip-172-31-17-173:/etc/apache2# service apache2 restart
root@ip-172-31-17-173:/etc/apache2# service apache2 status
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: active (running) since Sun 2018-11-11 02:16:20 UTC; 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2031 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 2056 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)
    Tasks: 55
   Memory: 6.3M
      CPU: 52ms
   CGroup: /system.slice/apache2.service
           ├─2075 /usr/sbin/apache2 -k start
           ├─2078 /usr/sbin/apache2 -k start
           └─2079 /usr/sbin/apache2 -k start 


mysql> update wp_options set option_value='http://52.43.18.20/wpujijayatransbe/' where option_id='1' or option_id='2';
Query OK, 2 rows affected (0.01 sec)
Rows matched: 2  Changed: 2  Warnings: 0


mysql> select * from wp_options where option_id='1' or  option_id='2';
+-----------+-------------+--------------------------------------+----------+
| option_id | option_name | option_value                         | autoload |
+-----------+-------------+--------------------------------------+----------+
|         1 | siteurl     | http://52.43.18.20/wpujijayatransbe/ | yes      |
|         2 | home        | http://52.43.18.20/wpujijayatransbe/ | yes      |
+-----------+-------------+--------------------------------------+----------+
2 rows in set (0.00 sec)
Share This :

0 comments