MySQL設定所有IP位址都可以訪問資料庫

2022-05-10 08:48:18 字數 645 閱讀 6773

1. 登入mysql

mysql -u root -p

select user,host from user;

查詢結果應該如下圖所示:

grant all privileges on \*.* to root@'%'  identified  by 'root'

其中 第乙個*表示資料庫名;第二個*表示該資料庫的表名;如果像上面那樣 *.*的話表示所有到資料庫下到所有表都允許訪問;

『%』:表示允許訪問到mysql的ip位址;當然你也可以配置為具體到ip名稱;%表示所有ip均可以訪問;

修改後的查詢結果應該如下圖所示:

設定IP位址

root biaozhi nano etc sysconfig network scripts ifcfg eth0 device eth0 裝置名稱 onboot yes 開機啟動 bootproto static 靜態位址引導 ipaddr 192.168.6.80 ip位址 netmask 2...

設定固定IP位址

在 linux 上可以通過 ifconfig 和route 命令新增 ip別名。現在我們在eth0 上新增兩個 ip別名 192.168.0.111 和192.168.0.112 shell ifconfig eth0 1 192.168.0.111 broadcast 192.168.0.255 ...

設定ip位址,vm設定mac與ip

eth0為本地網絡卡 設定靜態ip vi etc sysconfig network scripts ifcfg eth0 dmesg grep eth0 命令進行檢視並更新 type ethernet uuid 95a6c75d c047 48d9 a534 51034f566725 也建議修改 ...