NetBeans 6.1 has an interface to manage MySql, including start and stop MySql database server, connect/disconnect from databases, launch external MySql admin tool, execute queries, etc. Here are steps to configure MySql management inside NetBeans:
1. Create a wrapper script for mysqld_safe. The reason is that mysqld start script assumes the user is running the script from mysql base directory. An attempt to start
mysql/bin directory results in the following error:
/home/me/mysql/bin > ./mysqld_safeSo I created script
./mysqld_safe: 199: my_print_defaults: not found
./mysqld_safe: 204: my_print_defaults: not found
The file /usr/local/mysql/bin/mysqld doesn't exist or is not executable
Please do a cd to the mysql installation directory and restart
this script from there as follows:
See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more information
/home/me/mysql/bin/mymysqld_safe, which can be called by NetBeans:
#! /bin/shI had also tried changing mysqld_safe script to replace the hardcoded ./bin/ with `dirname $0`, but it caused other errors. So I figured the best option is to use a wrapper without touching mysql files.
2. Go to NetBeans Window | Services tab, and right-click DataBases node. Choose Properties.
Server host name: localhost
Server port number: 3306
Administrator user name: root
Path/URL to admin tool: /usr/bin/mysql-admin
Path to start command: /home/me/mysql/bin/mymysqld_safe
Path to stop command: /home/me/mysql/bin/mysqladmin
Arguments to stop command: -u root shutdown
How to install MySql admin tool and Query Browser is posted in the previous post Install MySql GUI tools (MySql Administrator and Query Browser) .