Delphi MySQL 用戶問題 |
答題得分者是:syntax
|
emilynatiki
一般會員 發表:5 回覆:8 積分:2 註冊:2007-02-10 發送簡訊給我 |
各位高手, 本人已寫好一個系統但在實行時遇到一些問題:
因為要連到mysql db 的時候在connection有下列setting server: 192.168.0.1 username:yt password:123123 但如果我將exe放到ip為192.168.0.11的pc的時候, 便必須到server的mysql中加一個新用戶yt@192.168.0.11 由於ip是自動派的, 如果每次ip都不同, 又要再加用戶方可使用, 那實在太麻煩了, 有沒有其他方法可以解決呢?? 而在運行時還遇到另一個問題, 如果正在由其中一個用戶運行, 其他人好像不可以連到db似的....每次都說系統沒有反應.... 系統好像只可供一個用戶登入似的.....是不是我在做設定時做錯什麼呢?? 感謝各位幫忙!!!!!!!!!! | ||||||||||||||||||||||||||||||
syntax
尊榮會員 發表:26 回覆:1139 積分:1258 註冊:2002-04-23 發送簡訊給我 |
我想你沒有仔細學習過 MySQL 喔!
MySQL 的權限管理是階層性的,連線 -> DB -> Table -> Field 並組合 使用帳號、密碼、來源、與權限來管理 你只要設定 1.某帳號,某密碼,某來源 --> 可以連線,最小權限 2.然後再在資料庫(甚至是 Table, Fiels)開放應該有的功能,即可達到「近乎」安全的控管 關於來源的管理,如下:(建議你去 MySQL 抓一份 Reference Manual,提供你的答案,也是由其中複製出來的) Data from MySQL reference Manual 5.7.5. Access Control, Stage 1: Connection Verification GRANT ALL PRIVILEGES ON db.* TO david@'192.58.197.0/255.255.255.0';This allows david to connect from any client host having an IP number client_ip for which the following condition is true: client_ip & netmask = host_ipThat is, for the GRANT statement just shown: client_ip & 255.255.255.0 = 192.58.197.0IP numbers that satisfy this condition and can connect to the MySQL server are those in the range from 192.58.197.0 to 192.58.197.255. Note: The netmask can only be used to tell the server to use 8, 16, 24, or 32 bits of the address. Examples:
192.168.0.1/255.255.255.240 The following table shows how various combinations of Host and User values in the user table apply to incoming connections.
===================引 用 emilynatiki 文 章=================== 各位高手, 本人已寫好一個系統但在實行時遇到一些問題: 因為要連到mysql db 的時候在connection有下列setting server: 192.168.0.1 username:yt password:123123 但如果我將exe放到ip為192.168.0.11的pc的時候, 便必須到server的mysql中加一個新用戶yt@192.168.0.11 由於ip是自動派的, 如果每次ip都不同, 又要再加用戶方可使用, 那實在太麻煩了, 有沒有其他方法可以解決呢?? 而在運行時還遇到另一個問題, 如果正在由其中一個用戶運行, 其他人好像不可以連到db似的....每次都說系統沒有反應.... 系統好像只可供一個用戶登入似的.....是不是我在做設定時做錯什麼呢?? 感謝各位幫忙!!!!!!!!!! |
||||||||||||||||||||||||||||||
emilynatiki
一般會員 發表:5 回覆:8 積分:2 註冊:2007-02-10 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |