반응형

AWS, Centos 7 -- ec2 처음 설치후 맥에서 접속하기





** 터미널에서 접속하기


$ ssh -i "myawsrest.pem" centos@52.78.173.10




** root 사용자로 바꾸자..  (root pass는 1234 로 일단 사용한다.)


[centos@ip-172-31-10-190 ~]$ sudo passwd root

root 사용자의 비밀 번호 변경 중

새  암호:

잘못된 암호: 암호는 8 개의 문자 보다 짧습니다

새  암호 재입력:

passwd: 모든 인증 토큰이 성공적으로 업데이트 되었습니다.

[centos@ip-172-31-10-190 ~]$


[centos@ip-172-31-10-190 ~]$ su -

암호:

마지막 로그인: 토  1월 14 05:38:35 UTC 2017 58.150.175.95에서 시작 일시 pts/0

[root@ip-172-31-10-190 ~]#





** 타임존 바꾸기  ; 한국 시간으로.. (aws 서울서버지만 한국시간아니므로...)


[root@ip-172-31-10-190 ~]# date

Sun Jan 15 04:37:11 UTC 2017

[root@ip-172-31-10-190 ~]# mv /etc/localtime /etc/localtime_org

[root@ip-172-31-10-190 ~]# ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime

[root@ip-172-31-10-190 ~]#

[root@ip-172-31-10-190 ~]# date

Sun Jan 15 13:38:38 KST 2017

[root@ip-172-31-10-190 ~]#





** 마리아db 설치하기


[root@ip-172-31-10-190 ~]# yum install mariadb-server



[root@ip-172-31-10-190 ~]#

[root@ip-172-31-10-190 ~]# systemctl enable mariadb

Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

[root@ip-172-31-10-190 ~]# systemctl start mariadb

[root@ip-172-31-10-190 ~]#

[root@ip-172-31-10-190 ~]# systemctl status mariadb

● mariadb.service - MariaDB database server

   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)

   Active: active (running) since Sun 2017-01-15 13:50:35 KST; 13s ago




** mariadb 환경 설정 (root 암호는 서버 root 암호와 같이 함 ; 1234 )


[root@ip-172-31-10-190 ~]# mysql_secure_installation


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.


Enter current password for root (enter for none):

OK, successfully used password, moving on...


Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.


Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!



By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.


Remove anonymous users? [Y/n] y

 ... Success!


Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.


Disallow root login remotely? [Y/n] y

 ... Success!


By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.


Remove test database and access to it? [Y/n] y

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!


Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.


Reload privilege tables now? [Y/n] y

 ... Success!


Cleaning up...


All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.


Thanks for using MariaDB!

[root@ip-172-31-10-190 ~]#




**  mariadb 한글 설정


[root@ip-172-31-10-190 ~]# pwd

/root

[root@ip-172-31-10-190 ~]# cd /etc

[root@ip-172-31-10-190 etc]# cd my.cnf.d

[root@ip-172-31-10-190 my.cnf.d]# ls -al

total 24

drwxr-xr-x.  2 root root   64 Jan 15 13:47 .

drwxr-xr-x. 78 root root 8192 Jan 15 13:47 ..

-rw-r--r--.  1 root root  295 Sep 12 23:54 client.cnf

-rw-r--r--.  1 root root  232 Sep 12 23:54 mysql-clients.cnf

-rw-r--r--.  1 root root  744 Sep 12 23:54 server.cnf

[root@ip-172-31-10-190 my.cnf.d]#


[root@ip-172-31-10-190 my.cnf.d]# vi client.cnf



[client]

default-character-set=utf8




[root@ip-172-31-10-190 my.cnf.d]#

[root@ip-172-31-10-190 my.cnf.d]# vi mysql-clients.cnf



[mysql]

default-character-set=utf8


[mysql_upgrade]


[mysqladmin]


[mysqlbinlog]


[mysqlcheck]


[mysqldump]

default-character-set=utf8


[mysqlimport]

default-character-set=utf8






[root@ip-172-31-10-190 my.cnf.d]#

[root@ip-172-31-10-190 my.cnf.d]# vi server.cnf



[mysqld]

init_connect=SET collation_connection=utf8_general_ci

init_connect=SET NAMES utf8

#default-character-set=utf-8

character-set-server=utf8

collation-server=utf8_general_ci

max_allowed_packet=500M




[root@ip-172-31-10-190 my.cnf.d]#

[root@ip-172-31-10-190 my.cnf.d]#

[root@ip-172-31-10-190 my.cnf.d]# systemctl restart mariadb



** mariadb  db생성 후 사용자 생성 하고, 권한부여



[root@ip-172-31-10-190 my.cnf.d]# mysql -u root -p


MariaDB [(none)]> show variables like 'c%';

+--------------------------+----------------------------+

| Variable_name            | Value                      |

+--------------------------+----------------------------+

| character_set_client     | utf8                       |

| character_set_connection | utf8                       |

| character_set_database   | utf8                       |

| character_set_filesystem | binary                     |

| character_set_results    | utf8                       |

| character_set_server     | utf8                       |

| character_set_system     | utf8                       |

| character_sets_dir       | /usr/share/mysql/charsets/ |

| collation_connection     | utf8_general_ci            |

| collation_database       | utf8_general_ci            |

| collation_server         | utf8_general_ci            |

| completion_type          | NO_CHAIN                   |

| concurrent_insert        | AUTO                       |

| connect_timeout          | 10                         |

+--------------------------+----------------------------+

14 rows in set (0.00 sec)


MariaDB [(none)]>


MariaDB [(none)]> create database testdb;

Query OK, 1 row affected (0.00 sec)


MariaDB [(none)]> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| testdb             |

+--------------------+

4 rows in set (0.00 sec)


MariaDB [(none)]>

MariaDB [(none)]> create user 'park@localhost' identified by '1234';

Query OK, 0 rows affected (0.00 sec)


MariaDB [(none)]> grant all on testdb.* to 'park' identified by '1234';

Query OK, 0 rows affected (0.00 sec)


MariaDB [(none)]>




** 맥에서 workbench 설치하여 aws mariadb 접속하기



https://dev.mysql.com/downloads/workbench/




<< 프론트엔트 개발 >>


 15:23:33  ...Documents/dev/aws 🐍 system

$ git clone https://github.com/angular/quickstart.git myApp



$ sudo git clone https://github.com/angular/quickstart.git myApp

Password:



--> 설치 초기에  the Xcode license agreements 물어보는 경우에는 동의 해줘야 다음 진행 가능하다.. 

   ; "agree" 를 입력 해줘야한다.




 15:25:02  ...Documents/dev/aws 🐍 system

$ cd myApp 



$ sudo npm install



$ sudo npm start


--> 웹브라우저 실행되면 ok!










반응형

'Linux' 카테고리의 다른 글

ubuntu -- 설치된 프로그램 확인하기  (0) 2020.12.30
putty -- iputty 로 설치하자.  (0) 2020.12.28
ubuntu -- 파일, 디렉토리 관련 명령어  (0) 2016.01.04
SIGINT -- POSIX signal  (0) 2015.11.14
ubuntu -- find ; 파일찾기  (0) 2015.10.27
Posted by 자유프로그램
,