root@q381-0663:/# mysqldump
bash: mysqldump: command not found
오랜만에 백업해보려니 mysqldump 명령어가 실행되지 않더군요..
$ which mysqldump
위 명령어가 mysqldump를 찾는 명령어인데, 해보니 없는 거 같더군요.
아마 일전에 php7.4 업데이트할 때 같이 어떻게 되버린거 같았습니다;;
root@q381-0663:/# dpkg -l | grep -i mysql
ii dbconfig-mysql 2.0.4ubuntu1 all dbconfig-common MySQL/MariaDB support
ii libdbd-mysql-perl 4.033-1ubuntu0.1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient20:amd64 5.7.29-0ubuntu0.16.04.1 amd64 MySQL database client library
iU mysql-client 5.7.29-0ubuntu0.16.04.1 all MySQL database client (metapackage depending on the la test version)
iU mysql-client-core-5.7 5.7.29-0ubuntu0.16.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.7.29-0ubuntu0.16.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii php-mysql 1:7.0+35ubuntu6.1 all MySQL module for PHP [default]
ii php7.0-mysql 7.0.33-27+ubuntu16.04.1+deb.sury.org+1 amd64 MySQL module for PHP
ii php7.4-mysql 7.4.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 MySQL module for PHP
rc phpmyadmin 4:4.5.4.1-2ubuntu2.1 all MySQL web administration tool
$ dpkg -l | grep -i mysql
mysqldump를 찾아보니 이렇게 있긴 하던데,
ii가 있고 iU가 있던데 이건 또 뭔지 찾아보니..ㅠ
'ubuntu ii iu 차이' 이라고 구글링해보니깐 뜨더군요.
install Unkown인지 uninstall 인지 여튼-_-; 그런거 같아서..
root@q381-0663:/# apt-get install mysql-client-core-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mariadb-server-10.0 : Depends: mariadb-client-10.0 (>= 10.0.38-0ubuntu0.16.04.1) but it is not going to be installed
Recommends: libhtml-template-perl but it is not going to be installed
mysql-client : Depends: mysql-client-5.7 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@q381-0663:/# apt-get install mysql-client-5.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
mariadb-server-10.0 : Depends: mariadb-client-10.0 (>= 10.0.38-0ubuntu0.16.04.1) but it is not going to be installed
Recommends: libhtml-template-perl but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@q381-0663:/# mysqldump
bash: mysqldump: command not found
root@q381-0663:/# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
apache2-data apache2-utils dbconfig-common dbconfig-mysql fakeroot fonts-dejavu fonts-dejavu-extra gettext javascript-common libapr1 libaprutil1
libaprutil1-dbd-sqlite3 libaprutil1-ldap libasprintf-dev libfakeroot libgettextpo-dev libgettextpo0 libjs-jquery libjs-sphinxdoc libjs-underscore liblua5.1-0
libnuma1 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix2 libssl-dev libssl-doc libunistring0 munin-doc php-gettext php-phpseclib php-tcpdf rrdtool
zlib1g-dev
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
mariadb-client-10.0 mariadb-client-core-10.0
The following packages will be REMOVED:
mysql-client mysql-client-core-5.7
The following NEW packages will be installed:
mariadb-client-10.0 mariadb-client-core-10.0
0 upgraded, 2 newly installed, 2 to remove and 105 not upgraded.
3 not fully installed or removed.
Need to get 5,448 kB of archives.
After this operation, 14.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 mariadb-client-core-10.0 amd64 10.0.38-0ubuntu0.16.04.1 [4,286 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 mariadb-client-10.0 amd64 10.0.38-0ubuntu0.16.04.1 [1,162 kB]
Fetched 5,448 kB in 2s (2,031 kB/s)
(Reading database ... 107730 files and directories currently installed.)
Removing mysql-client-core-5.7 (5.7.29-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Selecting previously unselected package mariadb-client-core-10.0.
(Reading database ... 107721 files and directories currently installed.)
Preparing to unpack .../mariadb-client-core-10.0_10.0.38-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-client-core-10.0 (10.0.38-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
dpkg: mysql-client: dependency problems, but removing anyway as you requested:
dbconfig-mysql depends on mysql-client | mariadb-client | virtual-mysql-client; however:
Package mysql-client is to be removed.
Package mariadb-client is not installed.
Package virtual-mysql-client is not installed.
Package mariadb-client-10.0 which provides virtual-mysql-client is not installed.
(Reading database ... 107729 files and directories currently installed.)
Removing mysql-client (5.7.29-0ubuntu0.16.04.1) ...
Selecting previously unselected package mariadb-client-10.0.
(Reading database ... 107726 files and directories currently installed.)
Preparing to unpack .../mariadb-client-10.0_10.0.38-0ubuntu0.16.04.1_amd64.deb ...
Unpacking mariadb-client-10.0 (10.0.38-0ubuntu0.16.04.1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mariadb-client-core-10.0 (10.0.38-0ubuntu0.16.04.1) ...
Setting up mariadb-client-10.0 (10.0.38-0ubuntu0.16.04.1) ...
Setting up libnuma1:amd64 (2.0.11-1ubuntu1.1) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
root@q381-0663:/# mysqldump
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help
$ apt-get -f install
성공!-_-;
참조
https://askubuntu.com/questions/735711/what-does-ii-mean-in-dpkg-list-command-output
참조
https://zetawiki.com/wiki/%EC%9A%B0%EB%B6%84%ED%88%AC_mysqldump_%EC%84%A4%EC%B9%98