메뉴 건너뛰기

조회 수 7655 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

/*---------------------------------------------------------------------------------------*/

mysql을 설치하자.. 요건 좀 어려울라나~ 우선 고고~~~

그런데 이상하다. 아래처럼 설치하니 뭔가 이상함  항상 쓰던 mysql 접속에서

...그래서 우선 삭제 요점은 맨밑에

/*---------------------------------------------------------------------------------------*/

[root@localhost ~]# yum -y install mysql 

  --생략--  
  perl-podlators.noarch 0:2.5.1-3.el7                     perl-threads.x86_64 0:1.87-4.el7                  
  perl-threads-shared.x86_64 0:1.43-6.el7               

Complete!
 [root@localhost ~]# yum erase mysql
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.41-2.el7_0 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                 Arch                   Version                          Repository             Size
=======================================================================================================
Removing:
 mariadb                 x86_64                 1:5.5.41-2.el7_0                 @base                  49 M

Transaction Summary
=======================================================================================================
--생략--

  Erasing    : 1:mariadb-5.5.41-2.el7_0.x86_64                                                           1/1
  Verifying  : 1:mariadb-5.5.41-2.el7_0.x86_64                                                           1/1

Removed:
  mariadb.x86_64 1:5.5.41-2.el7_0                                                                           

Complete!

/*---------------------------------------------------------------------------------------*/

mariadb?? 이게 뭐지.. 검색해보니 centos7에서 mysql은 다운받아서 써야됨 젠장

그럼 다운받아주지..아래 그림설명해놔야징..

/*---------------------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------------------*/

mysql 홈페이지 다운로드->yum  들어가서 centos7이니까 linux7 다운로드 하자

그담에 받은 패키지를 올려볼까~~ 경로는 맘대로 /usr/etc 요기에 넣었당. 

/*---------------------------------------------------------------------------------------*/

/*---------------------------------------------------------------------------------------*/

자 올렸다.. 올리는 방법은 툴을 이용하는게 좋을듯. 하는김에 툴도 올려놓자 sshclient 아주 자주 사용하니까

그럼 다시 설치 시작

/*---------------------------------------------------------------------------------------*/

[root@localhost ~]# yum -y install /usr/etc/mysql-community-release-el7-5.noarch.rpm
Loaded plugins: fastestmirror
Examining /usr/etc/mysql-community-release-el7-5.noarch.rpm: mysql-community-release-el7-5.noarch
Marking /usr/etc/mysql-community-release-el7-5.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-release.noarch 0:el7-5 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                       Arch         Version        Repository                                   Size
=======================================================================================================
Installing:
 mysql-community-release       noarch       el7-5          /mysql-community-release-el7-5.noarch       4.3 k

Transaction Summary
=======================================================================================================
Install  1 Package

Total size: 4.3 k
Installed size: 4.3 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-community-release-el7-5.noarch                                              1/1
  Verifying  : mysql-community-release-el7-5.noarch                                             1/1

Installed:
  mysql-community-release.noarch 0:el7-5                                                                    

Complete!
[root@localhost ~]# yum -y install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: data.nicehosting.co.kr
 * extras: data.nicehosting.co.kr
 * updates: data.nicehosting.co.kr
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.24-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                          Arch             Version                 Repository                   Size
=======================================================================================================
Installing:
 mysql-community-server           x86_64           5.6.24-3.el7            mysql56-community            58 M

Transaction Summary
=======================================================================================================
Install  1 Package

Total download size: 58 M
Installed size: 244 M
Downloading packages:
mysql-community-server-5.6.24-3.el7.x86_64.rpm                                        |  58 MB  00:00:09    
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-community-server-5.6.24-3.el7.x86_64                                            1/1
  Verifying  : mysql-community-server-5.6.24-3.el7.x86_64                                           1/1

Installed:
  mysql-community-server.x86_64 0:5.6.24-3.el7                                                              

Complete!
[root@localhost ~]# systemctl start mysqld  <-(요건 뭐 mysql 실행하는거야) 

[root@localhost ~]# systemctl enable mysqld <-(요것도 뭐 당연히 해야 재부팅시 자동으로 올라온다)

/*---------------------------------------------------------------------------------------*/

여까지 했으면 재부팅 해보는것도 나쁘지 않을듯. 정말 작동되는지도 확인해보고..

그럼 이제 작동하는지 확인해 볼까~~! 시작.. 

/*---------------------------------------------------------------------------------------*/

[root@localhost ~]# mysql -u root -p <-(처음에는 비밀번호가 설정되어있지 않으니 설정해야 겠지)
Enter password:  <-요기서 엔터 치면 바로 넘어감
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> use mysql <- (디비를 선택하고)
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> update user set password=password('1111') where user='root';

(쿼리문 설명 user 테이블에서  root라는 유저를 찾아서 패스워드를 1111로 업데이트 해라.)

Query OK, 4 rows affected (0.01 sec)
Rows matched: 4  Changed: 4  Warnings: 0

mysql> flush privileges; <-(요거 해줘야 패스워드 업데이트 된다.)
Query OK, 0 rows affected (0.00 sec) 

mysql> quit <- (mysql query 종료 exit<-요명령도 됨)
Bye
[root@localhost ~]# mysql -u root -p
Enter password: <-(이제 아까 넣었던 패스워드 입력하고 엔터)
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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>  

/*---------------------------------------------------------------------------------------*/

이제 몇가지 mysql query문을 해볼까~~ 자 해보자 위에문 연결하여 계속간다. 

/*---------------------------------------------------------------------------------------*/

mysql> show databases;
+--------------------+
| Database                    

+--------------------+
| information_schema      
| mysql                         
| performance_schema    
+--------------------+
3 rows in set (0.00 sec)

mysql>

/*---------------------------------------------------------------------------------------*/

위에 3개의 db는 직접적으로 사용하지 않는다. 그런데 내용이 보고싶다면??

한번 볼까? 그럼 아까 수정했던 mysql db를 한번 보자 

/*---------------------------------------------------------------------------------------*/

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql

+---------------------------+
| columns_priv             
| db                       
| event                    
| func                     
| general_log            
| help_category         

| help_keyword             
| help_relation            
| help_topic               
| innodb_index_stats       
| innodb_table_stats       
| ndb_binlog_index         
| plugin                   
| proc                     
| procs_priv               
| proxies_priv             
| servers                  
| slave_master_info        
| slave_relay_log_info     
| slave_worker_info        
| slow_log                 
| tables_priv              
| time_zone                
| time_zone_leap_second    
| time_zone_name           
| time_zone_transition     
| time_zone_transition_type
| user                     
+---------------------------+
28 rows in set (0.00 sec)

mysql> desc user;
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Field                  | Type                              | Null | Key | Default               | Extra |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
| Host                   | char(60)                          | NO   | PRI |                       |       |
| User                   | char(16)                          | NO   | PRI |                       |       |
| Password               | char(41)                          | NO   |     |                       |       |
| Select_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Insert_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Update_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Delete_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Create_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Drop_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Reload_priv            | enum('N','Y')                     | NO   |     | N                     |       |
| Shutdown_priv          | enum('N','Y')                     | NO   |     | N                     |       |
| Process_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| File_priv              | enum('N','Y')                     | NO   |     | N                     |       |
| Grant_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| References_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Index_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Show_db_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Super_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tmp_table_priv  | enum('N','Y')                     | NO   |     | N                     |       |
| Lock_tables_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Execute_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_slave_priv        | enum('N','Y')                     | NO   |     | N                     |       |
| Repl_client_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Create_view_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Show_view_priv         | enum('N','Y')                     | NO   |     | N                     |       |
| Create_routine_priv    | enum('N','Y')                     | NO   |     | N                     |       |
| Alter_routine_priv     | enum('N','Y')                     | NO   |     | N                     |       |
| Create_user_priv       | enum('N','Y')                     | NO   |     | N                     |       |
| Event_priv             | enum('N','Y')                     | NO   |     | N                     |       |
| Trigger_priv           | enum('N','Y')                     | NO   |     | N                     |       |
| Create_tablespace_priv | enum('N','Y')                     | NO   |     | N                     |       |
| ssl_type               | enum('','ANY','X509','SPECIFIED') | NO   |     |                       |       |
| ssl_cipher             | blob                              | NO   |     | NULL                  |       |
| x509_issuer            | blob                              | NO   |     | NULL                  |       |
| x509_subject           | blob                              | NO   |     | NULL                  |       |
| max_questions          | int(11) unsigned                  | NO   |     | 0                     |       |
| max_updates            | int(11) unsigned                  | NO   |     | 0                     |       |
| max_connections        | int(11) unsigned                  | NO   |     | 0                     |       |
| max_user_connections   | int(11) unsigned                  | NO   |     | 0                     |       |
| plugin                 | char(64)                          | YES  |     | mysql_native_password |       |
| authentication_string  | text                              | YES  |     | NULL                  |       |
| password_expired       | enum('N','Y')                     | NO   |     | N                     |       |
+------------------------+-----------------------------------+------+-----+-----------------------+-------+
43 rows in set (0.00 sec)

mysql>  

/*---------------------------------------------------------------------------------------*/

너무 길어졌다. query문은 고만~

요점정리 하자.. 또 필요하거나 주석달일 생기면 계속업데이트 해놔야징... 

/*---------------------------------------------------------------------------------------*/

 1.  mysql.com에서 패키지 다운 받아서 /usr/etc에 저장
 2. [root@localhost ~]# yum -y install /usr/etc/mysql-community-release-el7-5.noarch.rpm

 3. [root@localhost ~]# yum -y install mysql-community-server
 4. [root@localhost ~]# systemctl start mysqld  <-(요건 뭐 mysql 실행하는거야) 

 5. [root@localhost ~]# systemctl enable mysqld <-(요것도 뭐 당연히 해야 재부팅시 자동으로 올라온다)

 6. [root@localhost ~]# mysql -u root -p mysql

 7. mysql> update user set password=password('알아서넣자') where user='root';

 8. mysql> flush privileges;

 9. mysql> exit
10.[root@localhost ~]# 
 

 


List of Articles
번호 제목 날짜 조회 수
176 백업받기 2016.09.12 8010
175 리눅스... 디스크 가득 찼을 때 2016.09.12 7937
174 리눅스 yum 명령어 2016.09.11 7993
173 PHPIZE를 이용한 openSSL PHP 확장 모듈 설치 2016.09.11 8063
172 우분투(리눅스) 설치 USB 만들기 2016.08.10 8337
171 우분투(리눅스) 설치 USB 만들기 file 2016.08.10 8603
170 리눅스 SSH 로그인 점검 2016.07.26 9145
169 리눅스/날짜 시간 바꾸기 2016.07.22 7740
168 리눅스/RAID 설정하기 2 2016.07.22 7645
167 리눅스/RAID 설정하기 1 2016.07.22 8473
166 Root Disk를 Mirroring하는 방법 2016.07.22 8408
165 인코딩 깨진한글파일 삭제 방법 file 2016.07.22 8954
164 아파치(apache) 한글 URL 인식 모듈 설치 file 2016.07.22 9123
163 아파치(apache) 한글 URL 인식 모듈 설치 file 2016.07.22 9435
162 아파치(apache) 한글 URL 인식 모듈 설치 file 2016.07.22 8429
161 아파치 한글파일 인식설정 file 2016.07.22 8622
160 리눅스 읽기전용 파일시스템 / 파일 입/출력 오류 2016.07.22 12175
159 bind , 네임서버 구축 ( CentOS 6.x) file 2016.04.22 7084
158 Nikto - 웹 취약점 스캐너 도구 file 2016.04.22 9232
157 Apache Mod_Security 사용방법 2016.04.22 8912
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 12 Next
/ 12

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved