首頁  >  問答  >  主體

怎樣才能安裝mysql而不出錯呢?

此安裝的 MySQL 已升級到 5.7.40,如果仍需要執行 mysql_upgrade,請使用 --force dpkg:處理包 mysql-伺服器-5.7 時發生錯誤(--configure): 已安裝 mysql-伺服器-5.7 套件安裝後腳本子進程回傳錯誤退出狀態 1 處理時遇到錯誤: mysql-伺服器-5.7 E: 子進程 /usr/bin/dpkg 回傳錯誤代碼 (1)

我應該在這裡做什麼?

我嘗試了這些命令,但仍然出現錯誤:

sudo apt-get clean sudo apt-get 清除 mysql* sudo apt-get 更新 sudo apt-get install -f sudo apt-get install mysql-伺服器-5.7 sudo apt-get dist-upgrade

P粉959676410P粉959676410264 天前661

全部回覆(1)我來回復

  • P粉947296325

    P粉9472963252024-01-30 00:51:25

    嘗試這樣的事情。這對我有幫助:

    sudo service mysql stop
    sudo apt-get --purge remove mysql*
    sudo rm -rf /etc/mysql/ 
    Then I reinstalled it:
    
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install mariadb-server
    
    
    sudo service mysql start
    sudo mysql -u root -p
    secret
    
    
    sudo mysql -u root -p
    GRANT ALL PRIVILEGES on *.* to 'root'@'localhost' IDENTIFIED BY '';
    FLUSH PRIVILEGES;

    回覆
    0
  • 取消回覆