2024-02-29|閱讀時間 ‧ 約 23 分鐘

Ubuntu Server 24.04|22.04 安裝 MariaDB

    Update system packages

    sudo apt update && sudo apt upgrade -y
    raw-image


    Install additional dependencies

    sudo apt-get install wget software-properties-common dirmngr ca-certificates apt-transport-https -y


    Import MariaDB GPG key

    sudo wget -O- https://mariadb.org/mariadb_release_signing_key.asc | gpg --dearmor | sudo tee /usr/share/keyrings/mariadb.gpg


    Add MariaDB repository(Here to check version)

    echo deb [arch=amd64,arm64,ppc64el,s390x signed-by=/usr/share/keyrings/mariadb.gpg] http://mirror.mariadb.org/repo/11.2.3/ubuntu/ jammy main | sudo tee /etc/apt/sources.list.d/mariadb.list


    Update system packages

    sudo apt update


    Install MariaDB

    sudo apt install mariadb-server mariadb-client -y


    Check status of MariaDB

    systemctl status mariadb


    Set MariaDB(依據需求回答即可,畫面僅供參考,並非一定要這樣回答)

    sudo mysql_secure_installation




    test

    sudo mysql -u root -p





    分享至
    成為作者繼續創作的動力吧!
    © 2024 vocus All rights reserved.