메뉴 건너뛰기

조회 수 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 ~]# 
 

 


  1. No Image

    fdisk로 파티션 삭제하기

    Date2015.06.10 Views26023
    Read More
  2. No Image

    fdisk로 파티션 삭제하기

    Date2015.06.09 Views21723
    Read More
  3. No Image

    ethtool을 이용한 랜카드 설정

    Date2014.02.27 Views7929
    Read More
  4. No Image

    DHCP IP 자동 할당

    Date2017.03.11 Views7964
    Read More
  5. No Image

    cron을 이용한 DB자동백업

    Date2015.07.16 Views8204
    Read More
  6. No Image

    cron에 php 파일 등록 방법

    Date2016.03.18 Views7602
    Read More
  7. crontab 을 이용한 PHP 스케줄링 작업

    Date2017.02.02 Views8500
    Read More
  8. No Image

    crontab 설정 방법

    Date2017.02.02 Views7215
    Read More
  9. No Image

    crontab 사용법

    Date2021.03.26 Views246
    Read More
  10. No Image

    chkrootkit 0.49 설치 및 사용법 그리고 변조파일 정상 복원

    Date2014.03.26 Views8869
    Read More
  11. No Image

    centos7 sendmail 설치 및 세팅

    Date2020.12.31 Views467
    Read More
  12. Centos7 64bit 웹서버 만들기-소켓모듈설치(socket.io) CAP7

    Date2015.07.17 Views8552
    Read More
  13. No Image

    Centos7 64bit 웹서버 만들기-방화벽설치 CAP2

    Date2015.07.17 Views7838
    Read More
  14. Centos7 64bit 웹서버 만들기-PHP설치 CAP5

    Date2015.07.17 Views11979
    Read More
  15. Centos7 64bit 웹서버 만들기-mysql설치 CAP4

    Date2015.07.17 Views7655
    Read More
  16. CentOS6.6+httpd2.4.16+Mariadb10.0.20+php5.6.11 Source 설치....

    Date2016.09.25 Views14744
    Read More
  17. No Image

    centos 시작시 네트워크 모듈 추가

    Date2021.03.26 Views207
    Read More
  18. No Image

    centos 버전 확인

    Date2015.07.16 Views7614
    Read More
  19. CentOS ImageMagick 설치 php 연동

    Date2021.03.26 Views312
    Read More
  20. CentOS 7에 Owncloud 10 설치

    Date2020.12.21 Views3142
    Read More
Board Pagination Prev 1 ... 3 4 5 6 7 8 9 10 11 12 Next
/ 12

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved