
LAMP Ubuntu 16.04 MySQL 伺服器安裝問題
嘗試按照以下說明在 Ubuntu 16.04 上設定 LAMP 系統。 howtoforge ubuntu_lamp_for_newbies Apache 和 PHP 安裝並測試良好。 MariaDB 載入並測試良好,但無法讓 phpMyAdmin 運作。
試試以下 LAMP 安裝說明:digitalocean how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
嘗試刪除並重新載入。 如何在 ubuntu 15.10 上安裝或解除安裝半安裝的 mysql-client-5.6? 如何在 ubuntu 15.10 上安裝或解除安裝半安裝的 mysql-client-5.6?
Richard Uijen has suggested: ( changed for server 5.7)
sudo apt-get --purge remove mysql*
sudo apt-get autoremove mysql*
sudo rm -rf /etc/mysql/
sudo rm -rf /var/lib/mysql/
sudo apt-get clean
sudo apt-get update
sudo apt-get install --reinstall mysql-server-5.7
有軟體包安裝錯誤(也搞亂了其他軟體包安裝),報告的錯誤得到了上一期的回复,但 MySQL 安裝和之前的 MariaDB 安裝存在衝突。 https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071 MySQL 5.6 拒絕安裝在已安裝 MariaDB 10.0 的系統上,從而阻止使用者在沒有手動幹預的情況下恢復到 MySQL(又稱 mysql 標誌檔案系統需要重新設計)
嘗試刪除對兩者的任何引用。 (mariadb* 和 mysql* )解決了套件錯誤。
嘗試重新安裝MySQL:
sudo apt-get install mysql-server
mysql-server is already the newest version (5.7.12-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.7 (5.7.12-0ubuntu1) ...
update-alternatives: error: alternative path /etc/mysql/mysql.cnf doesn't exist
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 2
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
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
目前狀態:
mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
:systemctl status mysql.service
mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Tue 2016-05-24 07:12:23 CDT; 2h 45min ago
systemd[1]: Failed to start MySQL Community Server.
/etc/mysql does not exist.
現在虧本了?
答案1
我有這個確切的問題。在 /etc/mysql/ 目錄中尋找檔案名稱中帶有「deb10flag」的檔案。 (我記不清當我這樣做時該檔案的具體名稱是什麼,因為那是一個月前。)我透過刪除帶有 debian10flag 的檔案解決了這個問題。此設定由 MariaDB 安裝產生(它將 deb 標誌設為版本 10)。我刪除了 /etc/mysql/ 並從垃圾箱中清除了它的任何痕跡。完成所有這些操作後,套件儲存庫中的 mysql 設定存在依賴性問題。 mysql-cli 和 mysql-server 都依賴 mysql-common。這是透過以下順序安裝它們來解決的(我認為):(1)mysql-common,(2)mysql-cli,(3)mysql-server。
**我知道這還不清楚。我將回覆我用於解決此問題的確切步驟(很快)。但問題涉及 deb10flag 和依賴性問題。