阿里云配置MySQL-server?8.0遠(yuǎn)程登錄的實(shí)現(xiàn)
Ubuntu 22.04 LTS 安裝MySQL-Server 8.0
# apt search mysql-server # apt install mysql-server
重建服務(wù)
# 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)
開(kāi)發(fā)端口
# iptables -A INPUT -j ACCEPT
在阿里云上開(kāi)發(fā)端口映射,并標(biāo)注允許登錄的主機(jī)IP(此處擦去);
授權(quán)用戶(hù)登錄:
# 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)
這里密碼僅做演示,可以設(shè)置復(fù)雜的密碼。
另外一臺(tái)開(kāi)放IP的主機(jī),安裝MySQL客戶(hù)端
# apt search mysql-client # apt install mysql-client-8.0
遠(yuǎn)程登錄MySQL服務(wù)器
# 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遠(yuǎn)程登錄的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)阿里云配置MySQL遠(yuǎn)程登錄內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Mysql存儲(chǔ)過(guò)程如何實(shí)現(xiàn)歷史數(shù)據(jù)遷移
這篇文章主要介紹了Mysql存儲(chǔ)過(guò)程如何實(shí)現(xiàn)歷史數(shù)據(jù)遷移,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-01-01MySQL5.7 group by新特性報(bào)錯(cuò)1055的解決辦法
項(xiàng)目中本來(lái)使用的是mysql5.6進(jìn)行開(kāi)發(fā),切換到5.7之后,突然發(fā)現(xiàn)原來(lái)的一些sql運(yùn)行都報(bào)錯(cuò),錯(cuò)誤編碼1055,錯(cuò)誤信息和sql_mode中的“only_full_group_by“有關(guān)。下面小編給大家分享下解決辦法2016-12-12MySQL之FIND_IN_SET()的用法及說(shuō)明
這篇文章主要介紹了MySQL之FIND_IN_SET()的用法及說(shuō)明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-01-01MySQL數(shù)據(jù)表分區(qū)技術(shù)PARTITION詳解
在處理大規(guī)模數(shù)據(jù)時(shí),數(shù)據(jù)庫(kù)性能的優(yōu)化變得尤為重要,MySQL提供了一種稱(chēng)為“分區(qū)”(Partitioning)的技術(shù),可以顯著提高查詢(xún)效率和管理大型數(shù)據(jù)庫(kù)表的能力,本文將詳細(xì)介紹MySQL中的數(shù)據(jù)表分區(qū)技術(shù),包括其基本概念、類(lèi)型以及如何實(shí)現(xiàn)和維護(hù),需要的朋友可以參考下2025-02-02mysql允許外網(wǎng)訪(fǎng)問(wèn)以及修改mysql賬號(hào)密碼實(shí)操方法
這篇文章主要介紹了mysql允許外網(wǎng)訪(fǎng)問(wèn)以及修改mysql賬號(hào)密碼實(shí)操方法,有需要的朋友們可以參考學(xué)習(xí)下。2019-08-08sql語(yǔ)句中l(wèi)ike的用法詳細(xì)解析
以下是對(duì)sql語(yǔ)句中l(wèi)ike的用法進(jìn)行了詳細(xì)的分析介紹,需要的朋友可以過(guò)來(lái)參考下2013-08-08Windows10下mysql 5.7.17 安裝配置方法圖文教程
這篇文章主要為大家詳細(xì)介紹了Windows10下mysql5.7.17安裝配置方法圖文教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-02-02淺談MYSQL中樹(shù)形結(jié)構(gòu)表3種設(shè)計(jì)優(yōu)劣分析與分享
在開(kāi)發(fā)中經(jīng)常遇到樹(shù)形結(jié)構(gòu)的場(chǎng)景,本文將以部門(mén)表為例對(duì)比幾種設(shè)計(jì)的優(yōu)缺點(diǎn),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-09-09