用mysql怎麼進行遠端連線資料庫

時間 2021-08-30 11:13:07

1樓:搜虎哈哈

mysql遠端連線資料庫有兩種方法,具體如下:

改表法。  在localhost登入mysql後,更改 "mysql" 資料庫中的 "user" 表裡的 "host"選項,將"localhost"對應的值改為"%",具體**如圖所示:

2.授權法。若myuser想要使用mypassword(使用者密碼)從任何主機連線到mysql伺服器則可以使用此方法,具體步驟如下圖所示。

3.按照上述改法,儲存後重啟即可生效。

拓展資料:

資料庫(database)是按照資料結構來組織、儲存和管理資料的倉庫,它產生於距今六十多年前,隨著資訊科技和市場的發展,特別是二十世紀九十年代以後,資料管理不再僅僅是儲存和管理資料,而轉變成使用者所需要的各種資料管理的方式。

2.資料庫有很多種型別,從最簡單的儲存有各種資料的**到能夠進行海量資料儲存的大型資料庫系統都在各個方面得到了廣泛的應用。

3.在資訊化社會,充分有效地管理和利用各類資訊資源,是進行科學研究和決策管理的前提條件資料庫技術是管理資訊系統、辦公自動化系統、決策支援系統等各類資訊系統的核心部分,是進行科學研究和決策管理的重要技術手段。

4.資料庫是乙個單位或是乙個應用領域的通用資料處理系統,它儲存的是屬於企業和事業部門、團體和個人的有關資料的集合。資料庫中的資料是從全域性觀點出發建立的,按一定的資料模型進行組織、描述和儲存。

5.其結構基於資料間的自然聯絡,從而可提供一切必要的訪問路徑,且資料不再針對某一應用,而是面向全組織,具有整體的結構化特徵。

2樓:匿名使用者

1,確認你的linux主機是否能夠連線你的win7主機,可用ping命令或者telnet命令

ping 192.168.1.139或者telent 192.168.1.139 3306

2,如果你的linux主機與你的win7主機路由是通的,在你的win7的控制面板上開啟防火牆設定,確認你的3306埠沒有被防火牆遮蔽。

3,如果以上都沒有問題,請檢查你的mysql資料庫是否設定了連線許可權:

grant all privileges on *.* to 'root'@'%' identified by '11112222' with grant option;

是授權jack使用者密碼是123456在ip位址10.10.50.127的位址登陸,也可以用萬用字元%代替ip表示任何位址。

3樓:千鋒教育

一、連線遠端資料庫:

1、顯示密碼

如:mysql 連線遠端資料庫(192.168.5.116),埠「3306」,使用者名為「root」,密碼「123456」

c:/>mysql -h 192.168.5.116 -p 3306 -u root -p123456

2、隱藏密碼

如:mysql 連線本地資料庫,使用者名為「root」,

c:/>mysql -h localhost -u root -p

enter password:

二、配置mysql允許遠端鏈結

預設情況下,mysql帳號不允許從遠端登陸,只能在localhost登入。本文提供了二種方法設定mysql可以通過遠端主機進行連線。

一、改表法

在localhost登入mysql後,更改 "mysql" 資料庫裡的 "user" 表裡的 "host" 項,將"localhost"改稱"%"

例如:#mysql -u root -p

enter password:

……mysql>

mysql>update user set host = '%' where user = 'root';

mysql>select host, user from user;

二、授權法

例如: 你想myuser使用mypassword(密碼)從任何主機連線到mysql伺服器的話。

mysql>grant all privileges on *.* to 'myuser'@'%'identified by 'mypassword' with grant option;

如果你想允許使用者myuser從ip為192.168.1.6的主機連線到mysql伺服器,並使用mypassword作為密碼

mysql>grant all privileges on *.* to 'myuser'@'192.168.1.3'identified by

'mypassword' with grant option;

mysql>flush privileges

使修改生效,就可以了

常見問題:

1、在採用法二授權法之後,無法在本地登入mysql(如:#mysql -u root -p -h 192.168.5.116

enter password:

error 1045 (28000): access denied for user 'root'@'loadb116' (using password: yes)

上例中loadb116是主機名.

解決方法:

1、這時可以使用:mysql -u root -p 登入,進入到mysql後。

mysql> grant all privileges on *.* to 'root'@'loadb116'

identified by '123456' with grant option;

query ok, 0 rows affected (0.00 sec)

mysql> flush privileges;

query ok, 0 rows affected (0.00 sec)

2、在本地使用ip位址登入

# mysql -u root -p -h 192.168.5.116

enter password:

welcome to the mysql monitor. commands end with ; or /g.

your mysql connection id is 60

server version: 5.1.45 mysql community server (gpl)

type 'help;' or '/h' for help. type '/c' to clear the buffer.

mysql>

4樓:匿名使用者

如果你內網的機器通過路由器上網的話,那就應該在你的路由器上設定一下埠對映,就是把發到你路由器位址3306埠的請求發到你內網的機器3306埠上,挺簡單的

如何連線遠端mysql資料庫

5樓:匿名使用者

一、連線遠端資料庫:

1、顯示密碼

如:mysql

連線遠端資料庫(192.168.5.116),埠「3306」,使用者名為「root」,密碼「123456」

c:/>mysql -h

192.168.5.116 -p 3306 -u root -p123456

2、隱藏密碼

如:mysql 連線本地資料庫,使用者名為「root」,

c:/>mysql -h

localhost -u root -p

enter password:

二、配置mysql允許遠端鏈結

預設情況下,mysql帳號不允許從遠端登陸,只能在localhost登入。本文提供了二種方法設定mysql可以通過遠端主機進行連線。

一、改表法

在localhost登入mysql後,更改 "mysql" 資料庫裡的 "user" 表裡的 "host"

項,將"localhost"改稱"%"

例如:#mysql -u root

-penter password:

……mysql>

mysql>update user

set host = '%' where user = 'root';

mysql>select host,

user from user;

二、授權法

例如:你想myuser使用mypassword(密碼)從任何主機連線到mysql伺服器的話。

mysql>grant all

privileges on *.* to 'myuser'@'%'identified by 'mypassword' with grant option;

如果你想允許使用者myuser從ip為192.168.1.6的主機連線到mysql伺服器,並使用mypassword作為密碼

mysql>grant all

privileges on *.* to 'myuser'@'192.168.1.3'identified by

'mypassword' with grant option;

mysql>flush

privileges

使修改生效,就可以了

常見問題:

1、在採用法二授權法之後,無法在本地登入mysql(如:#mysql -u root -p -h

192.168.5.116

enter password:

error 1045 (28000): access denied for user

'root'@'loadb116' (using password: yes)

上例中loadb116是主機名.

解決方法:

1、這時可以使用:mysql -u

root -p 登入,進入到mysql後。

mysql> grant all privileges on *.* to 'root'@'loadb116'

identified by '123456' with grant option;

query ok, 0 rows affected

(0.00 sec)

mysql> flush

privileges;

query ok, 0 rows affected (0.00

sec)

2、在本地使用ip位址登入

# mysql -u root -p -h

192.168.5.116

enter password:

welcome to the mysql

monitor. commands end with ; or /g.

your mysql connection id is 60

server

version: 5.1.45 mysql community server (gpl)

type 'help;' or '/h' for

help. type '/c' to clear the buffer.

mysql>

mysql資料庫最大連線數可以設定為多少

胖大熙 mysql伺服器的最大併發連線數是16384。mysql作為一種開放源 的關係型資料庫管理系統 rdbms 使用最常用的資料庫管理語言結構化查詢語言 sql 進行資料庫管理。mysql伺服器的最大併發連線數受伺服器配置,及網路環境等制約,實際伺服器支援的併發連線數會小一些,主要決定因素有 伺...

mysql資料庫,連線數,一秒寫入多少條資料

mysql資料庫單錶插入速度每秒最高100000 rows沒問題,在標準配置下。mysql的讀寫速度跟硬碟的速度,網絡卡的速度,寫入行的資料量,資料在硬碟中的存放位置等等因素都有關係的。要統計這個最好的是進行測試,然後得出乙個平均值。沒有人能夠光通過配置得出這些資料的。第一次壓測配置 虛擬機器 資料...

怎麼解決mysql遠端連線報10038的錯誤

查一下你的mysql使用者表裡,是否允許遠端連線1 授權 mysql grant all privileges on to root identified by password with grant option mysql flush privileges mysql的使用者都有host限制的一...

其他用戶還看了: