国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Ubuntu > 正文

阿里云ECS(ubuntu16.04)安裝mysql遇到的一些問題

2024-06-28 16:04:44
字體:
來源:轉載
供稿:網友

離建立自己的站點就差安裝MySQL環境了,之前安裝過,一直覺得安裝mysql是個非常簡單的事情,還是遇到一些問題,特此刻錄下來以便需要的童鞋參考。

1、更新鏡像源;

apt-get update

2、安裝mysql-server

apt-get install mysql-server

這時提示出錯信息,安裝不成功,錯誤信息如下

Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following additional packages will be installed: libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server-5.7Suggested packages: libdata-dump-perl libipc-sharedcache-perl libwww-perl tinycaThe following NEW packages will be installed: libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server mysql-server-5.70 upgraded, 15 newly installed, 0 to remove and 78 not upgraded.E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)E: Unable to lock directory /var/cache/apt/archives/

經查明,此原因的問題是因為apt-get進程被占用

ps -aux

找到包含apt-get的進程信息

root 8436 0.0 0.0 0 0 ? S 08:12 0:00 [kworker/1:0]root 8826 0.0 0.0 0 0 ? S 08:18 0:00 [kworker/0:2]root 9121 0.0 0.0 0 0 ? S 08:18 0:00 [kworker/1:1]root 9835 0.0 0.0 0 0 ? S 08:31 0:00 [kworker/0:0]root 10250 0.0 0.0 0 0 ? S 09:13 0:00 [kworker/u4:2]root 10275 0.0 1.9 118924 79872 pts/0 S+ 09:16 0:00 apt-get install mysql-serverroot 10280 0.0 0.0 4508 784 pts/0 S+ 09:16 0:00 /bin/sh -c /usr/sbin/dpkg-PRecoroot 10281 0.0 0.4 62600 17404 pts/0 S+ 09:16 0:00 /usr/bin/perl -w /usr/sbin/dpkgroot 10287 0.0 0.0 0 0 pts/0 Z+ 09:16 0:00 [dpkg-preconfigu] <defunct>root 10292 0.0 0.0 12596 2960 pts/0 S+ 09:16 0:00 /bin/bash /tmp/mysql-server-5.7root 10296 0.0 0.0 20496 3176 pts/0 S+ 09:16 0:00 whiptail --backtitle Package coroot 10300 0.0 0.0 0 0 ? S 09:18 0:00 [kworker/u4:0]root 10301 0.0 0.1 95400 7004 ? Ss 09:19 0:00 sshd: root@pts/1root 10318 0.0 0.1 22496 5232 pts/1 Ss 09:19 0:00 -bashroot 10845 0.0 0.0 37364 3384 pts/1 R+ 09:30 0:00 ps -aux

使用

kill 10275

殺死該進程,繼續執行

apt-get install mysql-server

又出現錯誤

Reading package lists... DoneBuilding dependency tree Reading state information... DoneThe following additional packages will be installed: libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server-5.7Suggested packages: libdata-dump-perl libipc-sharedcache-perl libwww-perl tinycaThe following NEW packages will be installed: libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.0-5 libfcgi-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl libhttp-message-perl libio-html-perl liblwp-mediatypes-perl liburi-perl mysql-server mysql-server-5.70 upgraded, 15 newly installed, 0 to remove and 78 not upgraded.Need to get 0 B/3,144 kB of archives.After this Operation, 50.5 MB of additional disk space will be used.Do you want to continue? [Y/n] Ydebconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailableSelecting previously unselected package libevent-core-2.0-5:amd64.(Reading database ... 100455 files and directories currently installed.)Preparing to unpack .../libevent-core-2.0-5_2.0.21-stable-2_amd64.deb ...Unpacking libevent-core-2.0-5:amd64 (2.0.21-stable-2) ...Selecting previously unselected package mysql-server-5.7.Preparing to unpack .../mysql-server-5.7_5.7.17-0Ubuntu0.16.04.2_amd64.deb ...debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailabledpkg: error processing archive /var/cache/apt/archives/mysql-server-5.7_5.7.17-0ubuntu0.16.04.2_amd64.deb (--unpack): subprocess new pre-installation script returned error exit status 1debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailabledpkg: error while cleaning up: subprocess new post-removal script returned error exit status 1Selecting previously unselected package libhtml-tagset-perl.Preparing to unpack .../libhtml-tagset-perl_3.20-2_all.deb ...Unpacking libhtml-tagset-perl (3.20-2) ...Selecting previously unselected package liburi-perl.Preparing to unpack .../liburi-perl_1.71-1_all.deb ...Unpacking liburi-perl (1.71-1) ...Selecting previously unselected package libhtml-parser-perl.Preparing to unpack .../libhtml-parser-perl_3.72-1_amd64.deb ...Unpacking libhtml-parser-perl (3.72-1) ...Selecting previously unselected package libcgi-pm-perl.Preparing to unpack .../libcgi-pm-perl_4.26-1_all.deb ...Unpacking libcgi-pm-perl (4.26-1) ...Selecting previously unselected package libfcgi-perl.Preparing to unpack .../libfcgi-perl_0.77-1build1_amd64.deb ...Unpacking libfcgi-perl (0.77-1build1) ...Selecting previously unselected package libcgi-fast-perl.Preparing to unpack .../libcgi-fast-perl_1%3a2.10-1_all.deb ...Unpacking libcgi-fast-perl (1:2.10-1) ...Selecting previously unselected package libencode-locale-perl.Preparing to unpack .../libencode-locale-perl_1.05-1_all.deb ...Unpacking libencode-locale-perl (1.05-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 libhttp-date-perl.Preparing to unpack .../libhttp-date-perl_6.02-1_all.deb ...Unpacking libhttp-date-perl (6.02-1) ...Selecting previously unselected package libio-html-perl.Preparing to unpack .../libio-html-perl_1.001-1_all.deb ...Unpacking libio-html-perl (1.001-1) ...Selecting previously unselected package liblwp-mediatypes-perl.Preparing to unpack .../liblwp-mediatypes-perl_6.02-1_all.deb ...Unpacking liblwp-mediatypes-perl (6.02-1) ...Selecting previously unselected package libhttp-message-perl.Preparing to unpack .../libhttp-message-perl_6.11-1_all.deb ...Unpacking libhttp-message-perl (6.11-1) ...Selecting previously unselected package mysql-server.Preparing to unpack .../mysql-server_5.7.17-0ubuntu0.16.04.2_all.deb ...Unpacking mysql-server (5.7.17-0ubuntu0.16.04.2) ...Processing triggers for man-db (2.7.5-1) ...Errors were encountered while processing: /var/cache/apt/archives/mysql-server-5.7_5.7.17-0ubuntu0.16.04.2_amd64.debE: Sub-process /usr/bin/dpkg returned an error code (1)

仔細查看日志輸出信息,發現

debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable

執行

rm -rf /var/cache/debconf/*.dat

再次運行

apt-get install mysql-server

又出現一堆錯誤,蛋疼

Reading package lists... DoneBuilding dependency tree Reading state information... Donemysql-server is already the newest version (5.7.17-0ubuntu0.16.04.2).Suggested packages: tinycaThe following packages will be upgraded: mysql-server-5.71 upgraded, 0 newly installed, 0 to remove and 78 not upgraded.15 not fully installed or removed.Need to get 0 B/2,466 kB of archives.After this operation, 48.3 MB of additional disk space will be used.Preconfiguring packages ...(Reading database ... 100684 files and directories currently installed.)Preparing to unpack .../mysql-server-5.7_5.7.17-0ubuntu0.16.04.2_amd64.deb ...grep: /etc/mysql/: No such file or directoryUnpacking mysql-server-5.7 (5.7.17-0ubuntu0.16.04.2) over (5.7.17-0ubuntu0.16.04.2) ...Processing triggers for systemd (229-4ubuntu13) ...Processing triggers for ureadahead (0.100.0-19) ...Processing triggers for man-db (2.7.5-1) ...Setting up libevent-core-2.0-5:amd64 (2.0.21-stable-2) ...Setting up mysql-server-5.7 (5.7.17-0ubuntu0.16.04.2) ...update-alternatives: warning: alternative /etc/mysql/my.cnf.fallback (part of link group my.cnf) doesn't exist; removing from list of alternativesupdate-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choiceupdate-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto modeRenaming removed key_buffer and myisam-recover options (if present)ERROR: Unable to start MySQL server:mysqld: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2 - No such file or directory)mysqld: [ERROR] Fatal error in defaults handling. Program aborted!Please take a look at https://wiki.debian.org/Teams/MySQL/FAQ for tips on fixing common upgrade issues.Once the problem is resolved, run apt-get --fix-broken install to retry.dpkg: error processing package mysql-server-5.7 (--configure): subprocess installed post-installation script returned error exit status 1Setting up libhtml-tagset-perl (3.20-2) ...Setting up liburi-perl (1.71-1) ...Setting up libhtml-parser-perl (3.72-1) ...Setting up libcgi-pm-perl (4.26-1) ...Setting up libfcgi-perl (0.77-1build1) ...Setting up libcgi-fast-perl (1:2.10-1) ...Setting up libencode-locale-perl (1.05-1) ...Setting up libhtml-template-perl (2.95-2) ...Setting up libhttp-date-perl (6.02-1) ...Setting up libio-html-perl (1.001-1) ...Setting up liblwp-mediatypes-perl (6.02-1) ...Setting up libhttp-message-perl (6.11-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 unconfiguredProcessing triggers for libc-bin (2.23-0ubuntu5) ...Processing triggers for systemd (229-4ubuntu13) ...Processing triggers for ureadahead (0.100.0-19) ...Errors were encountered while processing: mysql-server-5.7 mysql-serverE: Sub-process /usr/bin/dpkg returned an error code (1)
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 巢湖市| 安岳县| 砚山县| 万荣县| 永修县| 景谷| 铜山县| 香河县| 日喀则市| 三门峡市| 盖州市| 揭西县| 宿州市| 洛南县| 尚义县| 无棣县| 巫山县| 阆中市| 翁源县| 江永县| 安陆市| 灵宝市| 五河县| 嘉禾县| 宜章县| 新河县| 南召县| 临夏市| 沅陵县| 景谷| 依安县| 凌云县| 阳原县| 阜平县| 肃宁县| 兴海县| 金沙县| 屏东县| 探索| 雅安市| 山西省|