Using MySQL with the IDE
See Also
The IDE comes with MySQL database support. In the Services window, a MySQL node appears under the Databases node when the IDE detects a running MySQL server on the local machine at the default port. The node is also registered automatically under the following conditions:
- If the IDE detects a recognized installation of MySQL. This is currently MAMP on Macintosh and XAMPP on Windows.
- If a MySQL connection is registered, the IDE auto-registers the MySQL node using the properties defined on the connection.
- If the user creates a new connection to MySQL, the IDE auto-registers the MySQL node at that time.
When you right-click the MySQL node, you see the following options:
- Create Database. Brings up a dialog for creating a database, including sample databases.
-
Note: When using MySQL 5.0 with Windows, some foreign characters may not be used when creating a database.
- Start. Starts the database server. If the user chooses this action and no start or stop command is set, then they are prompted to set the command.
- Stop. Stops the database server. If the user chooses this action and no start or stop command is set, then they are prompted to set the command.
- Connect. Connects the IDE to the MySQL database server.
- Disconnect. Disconnects the IDE ffrom the MySQL database server.
- Delete. Removes the MySQL node. It also marks the node as removed, so that next time the user starts up the IDE will not auto-register the node again. The user will need to manually register the node using Databases > Register MySQL Server.
- Refresh. Refreshes the list of databases based on what's currently on the server.
- Run Administration Tool. Brings up the administration tool that is registered with the runtime. The provider either invokes the admin tool as a separate system process, or if it is a web-based tool, brings up the provided URL in the default browser. If the administer command has not been set, then when the user picks the action, they are prompted to set the path to the command.
- Properties. Brings up a dialog that allows the user to configure important settings for the server. There are two tabs, one for basic settings and one for setting command paths to administrative commands (start, stop, administer)
When you expand the MySQL node, MySQL databases detected by the IDE appear under the node. By right-clicking a database, you can either connect to or delete the database.
If the IDE does not auto-detect and register the MySQL node, you can manually register it. In this case, the Databases node has a new subnode designed to register the server. When you right-click the Databases node, you see the following options:
- New Connection. When you choose New Connection, the New Database Connection dialog box appears.
- Register MySQL Database. If the IDE does not auto-detect and register the MySQL node, the user can manually register it. There will be a new action under Databases to register the server
- Enable Debug. Once debug mode is enabled, the IDE sends SQL statements to the Output window,
where you can view the log of statements. Debug mode does not list all SQL statements,
only those which you cannot see. For example, SQL queries for viewing data
are not logged.
- Disable Debug. This terminates the debugging function.
-
See Also
- Connecting to a Database
Legal Notices