如何在NetBeans 7.0.1(windows)中連接本地伺服器的MySQL資料庫?

如何在NetBeans 7.0.1(windows)中連接本地伺服器的MySQL資料庫?

NetBeans IDE 7.0.1 on Windows 7第一次使用我的 php.ini。實際上在我的公司有一個本地伺服器(192.168.1.99),所有專案都駐留在其中,我們訪問該本地伺服器的phpmyadmin,雖然我已經使用NetBeans 添加了我的專案資料夾(這也很忙) ,但現在我遇到了問題連接我的本地伺服器的資料庫,正如我 192.168.1.99/phpmyadmin透過瀏覽器。
我設定了以下值

Server Host : localhost,
Server port number : 3306,
Administrator username : keshav
Administrator password : ******

當我單擊“連接”時,會出現一個彈出錯誤窗口,其中包含以下文本

Unable to connect to the MySQL server:

org.netbeans.api.db.explorer.DatabaseException:  
org.netbeans.api.db.explorer.DatabaseException: java.sql.SQLException: Access denied  
for user 'keshav'@'localhost' (using password: YES).

The server may not be running or your MySQL connection properties 
may not be set correctly.  Do you want to edit your MySQL connection properties?

答案1

您關閉防火牆或建立允許流量通過 3306 連接埠的規則,或使用命令測試您的連線telnet localhost 3306。嘗試而不是localhost127.0.0.1

答案2

首先你需要在 ubuntu 中安裝 mysql-server 和 mysql-client。所以進入終端並編寫這段程式碼。但在根目錄中..將你的電腦連接到互聯網並嘗試這個“apt-get update”,然後等待幾分鐘,然後在更新完成時寫入“apt-get install mysql-server mysql-client”按回鍵並如果問什麼就說是..它將在幾分鐘內安裝。然後詢問密碼然後輸入你的密碼..然後從ubuntu軟體中心下載mysql查詢瀏覽器和mysql管理工具..之後你就可以使用了..

相關內容