--- title: 'Ubuntu 22.04 Mariadb install' tags: ubuntu,Mariadb description: Ubuntu 22.04 Mariadb install --- # Ubuntu 22.04 Mariadb install --- [TOC] --- ## Install Mariadb ``` terminal sudo apt update && sudo apt upgrade -y sudo apt-get install wget software-properties-common dirmngr ca-certificates apt-transport-https -y sudo apt install mariadb-server mariadb-client mariadb --version ```  --- ## 設定root資料 ``` terminal sudo mysql_secure_installation ```   --- ## 開通可遠端連線 ``` terminal mysql -u root -p mysql> GRANT ALL ON *.* to 'root'@'%' IDENTIFIED BY '*****' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES; mysql> exit; ``` 開防火牆 ``` terminal sudo ufw allow 3306/tcp ``` 修改config ``` terminal sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf ... bind-address = 0.0.0.0 ... ``` --- ## 參考鏈結 https://linuxhint.com/install-mariadb-ubuntu-22-04/ https://www.ewdna.com/2011/09/mysqlmessage-from-server-host-xxx-is.html https://webdock.io/en/docs/how-guides/database-guides/how-enable-remote-access-your-mariadbmysql-database
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.