日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

MySql:从任何主机授予根用户登录权限

發布時間:2023/12/9 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 MySql:从任何主机授予根用户登录权限 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Note that this is Not very secure, and should only be used for a local development box where you don’t feel like setting up individual permissions, but still need to connect from other machines.

請注意,這不是很安全,僅應用于您不想設置個人權限,但仍需要從其他計算機連接的本地開發箱。

To configure this feature, you’ll need to update the mysql user table to allow access from any remote host, using the % wildcard.

要配置此功能,您需要使用%通配符更新mysql用戶表,以允許從任何遠程主機進行訪問。

Open the command-line mysql client on the server using the root account.

使用根帳戶打開服務器上的命令行mysql客戶端。

mysql -uroot

mysql -uroot

Then you will want to run the following two commands, to see what the root user host is set to already:

然后,您將需要運行以下兩個命令,以查看root用戶主機已設置為什么:

use mysql;select host, user from user;

使用mysql;從用戶中選擇主機,用戶;

Here’s an example of the output on my database, which is pretty much the default settings. Note that ubuntuserv is the hostname of my server.

這是數據庫輸出的示例,幾乎是默認設置。 請注意,ubuntuserv是我的服務器的主機名。

mysql> use mysql;Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -ADatabase changed

mysql>使用mysql;讀取表信息以完成表和列名可以通過更改-ADatabase來關閉此功能以更快地啟動

mysql> select host,user from user;+—————+——————+| host | user |+—————+——————+|?ubuntuserv | root | | localhost | debian-sys-maint | | localhost | root | +—————+——————+3 rows in set (0.00 sec)

mysql>從用戶中選擇主機,用戶; + —————— + —————— + | 主機| 用戶| + —————— + —————— + | ubuntuserv | 根| | 本地主機| debian-sys-maint | | 本地主機| 根| + —————— + —————— ++ 3行(0.00秒)

Now I’ll update the ubuntuserv host to use the wildcard, and then issue the command to reload the privilege tables. If you are running this command, substitute the hostname of your box for ubuntuserv.

現在,我將更新ubuntuserv主機以使用通配符,然后發出命令以重新加載特權表。 如果您正在運行此命令,請用方框的主機名代替ubuntuserv。

update user set host=’%’ where user=’root’ and host=’ubuntuserv’;flush privileges;

更新用戶集host ='%',其中user ='root'和host ='ubuntuserv';刷新權限;

That’s all there is to it. Now I was able to connect to that server from any other machine on my network, using the root account.

這里的所有都是它的。 現在,我可以使用根帳戶從網絡上的任何其他計算機連接到該服務器。

Again, note this isn’t very secure, and you should at least make sure that you’ve set a root password.

再次提醒您,此操作不是很安全,并且至少應確保已設置root密碼。

翻譯自: https://www.howtogeek.com/howto/programming/mysql-give-root-user-logon-permission-from-any-host/

總結

以上是生活随笔為你收集整理的MySql:从任何主机授予根用户登录权限的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。