In our previous post we were installed the Netbeans IDE and MySQL Server RDBMS. Now in this blog, we will register the MySQL with Netbeans IDE for further development.
Let start the connectivity
Open the Netbeans IDE. Go to main menu Window -> Services (Ctrl +S)
Now in services tab, you can see the Database Node
Right-click the Databases node in the Services window and choose Register MySQL Server to open the MySQL Server Properties dialog box.
In the MySQL Server Properties dialog box,
- Server host name and port should be correct. The IDE enters
localhostas default server host name and default server port number 3306. The port number should be same as you have entered in port number during MySQL installation
- Enter the Administrator user name and password which is needed for administrative access to be able to create and remove databases. The default is set to blank. A blank password can also be a password.
Click the Admin Properties tab at the top of the dialog box. The Admin Properties tab is then displayed, allowing you to enter information for controlling the MySQL Server.
In the Path/URL to admin tool field, browse to the location of your MySQL Administration application such as the, MySQL Work bench, MySQL Admin Tool, PhpMyAdmin, or other web-based administration tools. MySQL admin tool
mysqladminis in the
binfolder of the MySQL installation directory. It is a not ideal for use with the IDE because it is a command line base.
Type any arguments for the admin tool in the Arguments field.
- In the Path to start command, type or browse to the location of the MySQL start command. To find the start command, look for
binfolder of the MySQL installation directory. Type any argument in field
In the Path to stop command field, type or browse to the location of the MySQL stop command. This is usually the path to
binfolder of the MySQL installation directory. If the command is
mysqladmin, in the Arguments field, type
-u root stopto grant
rootpermissions for stopping the server.
Now you can Start, Connect , Disconnect and Stop the database server. You can also start here My SQL Admisistrator Tool. which is in our case MySQL Workbench.
Starting the MySQL ServerBefore connecting to MySQL Database Server, first ensure that the MySQL Database Server is running. If the database server is not connected, disconnected shows at the next to the user name in the MySQL Server node in the Service window and you can not expand the node.
Right-click the Databases > MySQL Server node in the Services window and choose Connect. You might be prompted to supply a password to connect to the server.
When the server will connect you can expand the MySQL Server node and view the all available MySQL databases.
Congratulation, you have successfully connected the MySQL database server and MySql workbench database administration tool with Netbeans ide. Now you are able to access SQL database from MySQL database server to Netbeans IDE for applications development.