* 아래와 같은 알림 발생 시

1
2
3
4
5
The program 'mysql' can be found in the following packages:
 * mysql-client-core-5.7
 * mariadb-client-core-10.0
Try: sudo apt install <selected package>
 
cs



* 발생 원인

 : mysql 을 실행하기 위한 패키지가 설치되지 않아 발생되는 것으로 생각됩니다.



* 조치 사항

1. "mysql-server mysql-client" 를 설치합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
$ sudo apt install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libaio1 libevent-core-2.0-5 libhtml-template-perl mysql-client-5.7 mysql-client-core-5.7 mysql-common
  mysql-server-5.7 mysql-server-core-5.7
Suggested packages:
  libipc-sharedcache-perl mailx tinyca
The following NEW packages will be installed:
  libaio1 libevent-core-2.0-5 libhtml-template-perl mysql-client mysql-client-5.7 mysql-client-core-5.7
  mysql-common mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 18.6 MB of archives.
After this operation, 161 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-common all 5.7.20-0ubuntu0.16.04.1 [15.6 kB]
Get:2 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 libaio1 amd64 0.3.110-2 [6,356 B]
Get:3 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-core-5.7 amd64 5.7.20-0ubuntu0.16.04.1 [6,339 kB]
Get:4 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client-5.7 amd64 5.7.20-0ubuntu0.16.04.1 [1,675 kB]
Get:5 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-core-5.7 amd64 5.7.20-0ubuntu0.16.04.1 [7,670 kB]
Get:6 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libevent-core-2.0-5 amd64 2.0.21-stable-2ubuntu0.16.04.1 [70.6 kB]
Get:7 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-5.7 amd64 5.7.20-0ubuntu0.16.04.1 [2,708 kB]
Get:8 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 libhtml-template-perl all 2.95-2 [60.4 kB]
Get:9 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-client all 5.7.20-0ubuntu0.16.04.1 [10.1 kB]
Get:10 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server all 5.7.20-0ubuntu0.16.04.1 [10.2 kB]
Fetched 18.6 MB in 6s (2,949 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 215867 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.7.20-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-common (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../libaio1_0.3.110-2_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-2) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-client-core-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package libevent-core-2.0-5:amd64.
Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2ubuntu0.16.04.1_amd64.deb ...
Unpacking libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common (5.7.20-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 216035 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.20-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package libhtml-template-perl.
Preparing to unpack .../libhtml-template-perl_2.95-2_all.deb ...
Unpacking libhtml-template-perl (2.95-2) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../mysql-client_5.7.20-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-client (5.7.20-0ubuntu0.16.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.20-0ubuntu0.16.04.1_all.deb ...
Unpacking mysql-server (5.7.20-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up libaio1:amd64 (0.3.110-2) ...
Setting up mysql-client-core-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Setting up mysql-client-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Setting up mysql-server-core-5.7 (5.7.20-0ubuntu0.16.04.1) ...
Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2ubuntu0.16.04.1) ...
Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.
invoke-rc.d: initscript mysql, action "start" failed.
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since 월 2017-10-30 11:01:37 KST; 6ms ago
  Process: 35712 ExecStartPost=/usr/share/mysql/mysql-systemd-start post (code=exited, status=0/SUCCESS)
  Process: 35711 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 35690 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
 Main PID: 35711 (code=exited, status=1/FAILURE)
 
10월 30 11:01:37 user-virtual-machine systemd[1]: Failed to start MySQL Community Server.
10월 30 11:01:37 user-virtual-machine systemd[1]: mysql.service: Unit entered failed state.
10월 30 11:01:37 user-virtual-machine systemd[1]: mysql.service: Failed with result 'exit-code'.
dpkg: error processing package mysql-server-5.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
/bin/df: /mnt/hgfs: Protocol error
                                  Setting up libhtml-template-perl (2.95-2) ...
Setting up mysql-client (5.7.20-0ubuntu0.16.04.1) ...
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.7; however:
  Package mysql-server-5.7 is not configured yet.
 
dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 mysql-server-5.7
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
 
cs



2. root 계정의 비밀번호를 입력합니다.



3. root 계정의 비밀번호를 재입력합니다.



4. sudo mysql_secure_installation 명령을 실행합니다.

1
2
3
4
5
6
7
$ sudo mysql_secure_installation
 
Securing the MySQL server deployment.
 
Enter password for user root:
Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
 
cs

* docker 를 이용한 mysql 실행이기 때문에 해당 파일이 로컬에 존재하지 않아 에러가 발생하지만 무시합니다.



5. mysql 을 실행합니다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ mysql -h127.0.0.1 -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20 MySQL Community Server (GPL)
 
Copyright (c) 2000, 2017, 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>
 
cs



'Tools > Docker' 카테고리의 다른 글

Docker Toolbox 설치  (0) 2017.10.31
docker log 확인  (0) 2017.10.30
docker image 목록 확인  (0) 2017.10.30
docker container 실행 중지  (0) 2017.10.30
docker CE 삭제  (0) 2017.10.19

+ Recent posts