
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"가 있는 파일을 찾으십시오. (한달 전이라 이 작업을 했을 때 파일 이름이 정확히 무엇인지 기억이 나지 않습니다.) debian10플래그로 파일을 제거하여 해결했습니다. 이 설정은 MariaDB 설치로 생성됩니다(deb 플래그를 버전 10으로 설정). 나는 /etc/mysql/을 삭제하고 저장소에서 모든 흔적을 지웠습니다. 모든 작업을 수행한 후 패키지 저장소의 mysql 설정에 종속성 문제가 있습니다. mysql-cli와 mysql-server는 모두 mysql-common에 의존합니다. 이 문제는 (1) mysql-common, (2) mysql-cli, (3) mysql-server 순서로 설치하면 해결될 것 같습니다.
**이것이 명확하지 않다는 것을 알고 있습니다. 이 문제를 해결하기 위해 사용한 정확한 단계를 곧 답변해 드리겠습니다. 그러나 문제는 deb10flag 및 종속성 문제와 관련이 있습니다.