阿里云配置MySQL-server?8.0遠程登錄的實現(xiàn)
Ubuntu 22.04 LTS 安裝MySQL-Server 8.0
# apt search mysql-server # apt install mysql-server
重建服務
# service mysql stop # vi /etc/mysql/mysql.conf.d/mysqld.cnf ... bind-address = 0.0.0.0 ... # service mysql start # lsof -i:3306 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME mysqld 18386 mysql 23u IPv4 239692 0t0 TCP *:mysql (LISTEN)
開發(fā)端口
# iptables -A INPUT -j ACCEPT
在阿里云上開發(fā)端口映射,并標注允許登錄的主機IP(此處擦去);
授權(quán)用戶登錄:
# mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 8.0.34-0ubuntu0.22.04.1 (Ubuntu) Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create database book; Query OK, 1 row affected (0.01 sec) mysql> CREATE USER 'book'@'%' IDENTIFIED BY 'abcd1234'; Query OK, 0 rows affected (0.01 sec) mysql> GRANT select,update,insert,delete ON book.* TO 'book'@'%' ; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on book.* to book@'%'; Query OK, 0 rows affected (0.00 sec)
這里密碼僅做演示,可以設置復雜的密碼。
另外一臺開放IP的主機,安裝MySQL客戶端
# apt search mysql-client # apt install mysql-client-8.0
遠程登錄MySQL服務器
# mysql -h 172.16.0.1 -u book -P3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 20 Server version: 8.0.34-0ubuntu0.22.04.1 (Ubuntu) Copyright (c) 2000, 2023, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show databases; +--------------------+ | Database | +--------------------+ | book | | information_schema | | performance_schema | +--------------------+ 3 rows in set (0.00 sec) mysql>
到此這篇關(guān)于阿里云配置MySQL-server 8.0遠程登錄的實現(xiàn)的文章就介紹到這了,更多相關(guān)阿里云配置MySQL遠程登錄內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Mysql存儲過程如何實現(xiàn)歷史數(shù)據(jù)遷移
這篇文章主要介紹了Mysql存儲過程如何實現(xiàn)歷史數(shù)據(jù)遷移,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-01-01MySQL5.7 group by新特性報錯1055的解決辦法
項目中本來使用的是mysql5.6進行開發(fā),切換到5.7之后,突然發(fā)現(xiàn)原來的一些sql運行都報錯,錯誤編碼1055,錯誤信息和sql_mode中的“only_full_group_by“有關(guān)。下面小編給大家分享下解決辦法2016-12-12MySQL數(shù)據(jù)表分區(qū)技術(shù)PARTITION詳解
在處理大規(guī)模數(shù)據(jù)時,數(shù)據(jù)庫性能的優(yōu)化變得尤為重要,MySQL提供了一種稱為“分區(qū)”(Partitioning)的技術(shù),可以顯著提高查詢效率和管理大型數(shù)據(jù)庫表的能力,本文將詳細介紹MySQL中的數(shù)據(jù)表分區(qū)技術(shù),包括其基本概念、類型以及如何實現(xiàn)和維護,需要的朋友可以參考下2025-02-02mysql允許外網(wǎng)訪問以及修改mysql賬號密碼實操方法
這篇文章主要介紹了mysql允許外網(wǎng)訪問以及修改mysql賬號密碼實操方法,有需要的朋友們可以參考學習下。2019-08-08Windows10下mysql 5.7.17 安裝配置方法圖文教程
這篇文章主要為大家詳細介紹了Windows10下mysql5.7.17安裝配置方法圖文教程,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-02-02淺談MYSQL中樹形結(jié)構(gòu)表3種設計優(yōu)劣分析與分享
在開發(fā)中經(jīng)常遇到樹形結(jié)構(gòu)的場景,本文將以部門表為例對比幾種設計的優(yōu)缺點,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-09-09