How To: Manage MySQL Databases ============================== From the SiteWorx interface, SiteWorx users can create and manage MySQL databases. By default, all databases created in SiteWorx will be prefixed by the SiteWorx account unix username. While it is not possible to create non-prefixed databases from within SiteWorx, users with shell access may do so :doc:`from the CLI `. .. contents:: To Manage MySQL Databases ------------------------- Adding a Database ^^^^^^^^^^^^^^^^^ From the Databases Page ''''''''''''''''''''''' #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Click **+** or **Add a MySQL Database**. This opens the Add a MySQL Database form .. image:: /images/sw-add-database.png :alt: siteworx create mysql database #. Update the desired fields: - **Database Name**: The name of the database. SiteWorx will automatically append the unix username of the SiteWorx to the database name provided - **Create User**: Checking this box will expand the form to include database user options. Creating a database user for the new wordpress database is recommended - **Password/Confirm Password**: The password for the database user. Clicking the **Magic Wand** will automatically generate a secure password - **MySQL User Permissions**: The permissions the database user should have - **When Connecting From**: The host the database user will connect from. % is the default, which is a wildcard #. Click **Add** From the Add a MySQL Database Icon '''''''''''''''''''''''''''''''''' #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, click **Add a MySQL Database**. This opens the Add a MySQL Database form .. image:: /images/sw-add-database.png :alt: siteworx create mysql database #. Update the desired fields: - **Database Name**: The name of the database. SiteWorx will automatically append the unix username of the SiteWorx to the database name provided - **Create User**: Checking this box will expand the form to include database user options. Creating a database user for the new wordpress database is recommended - **Password/Confirm Password**: The password for the database user. Clicking the **Magic Wand** will automatically generate a secure password - **MySQL User Permissions**: The permissions the database user should have - **When Connecting From**: The host the database user will connect from. % is the default, which is a wildcard #. Click **Add** Deleting a Database ^^^^^^^^^^^^^^^^^^^ From the Database List '''''''''''''''''''''' #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Click the **Trashcan** icon next to the database to delete. This opens the Confirmation form .. image:: /images/sw-mysql-db-delete.png :alt: siteworx delete mysql database #. Select the **Confirm Action** checkbox #. Click **Delete** From the With Selected Dropdown ''''''''''''''''''''''''''''''' #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Select the **checkbox** next to the database(s) - Selecting the **checkbox** next to the With Selected dropdown will automatically select all databases #. Select **Delete** from the With Selected dropdown #. Click **Go**. This opens the Confirm Deletion form .. image:: /images/sw-mysql-db-delete.png :alt: siteworx delete mysql database #. Click **Delete** To Manage MySQL Database Permissions ------------------------------------ Adding Database User Permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Click the **Person** icon next to the Database. The opens the User Permissions page .. image:: /images/sw-db-perms.png :alt: siteworx database add user permissions #. Update the required fields: - **User**: The user that will be added to the database - **MySQL User Permissions**: The permissions the database user should have - **When Connecting From**: The host the database user will connect from. % is the default, which is a wildcard #. Click **Add** Editing Database User Permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Click the **Person** icon button next to the Database. The opens the User Permissions page .. image:: /images/sw-db-perms.png :alt: siteworx database add user permissions #. Under Existing Permissions, click the **Pencil** button next to the MySQL user. This opens the MySQL User Permissions form .. image:: /images/sw-mysql-perms.png :alt: mysql user edit form #. Update the desired permissions #. Click **Save** Deleting Database User Permissions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #. Log into SiteWorx from the browser (https://ip.ad.dr.ess:2443/siteworx) #. In SiteWorx, navigate to **Hosting Features > MySQL > Databases**, either from the side menu or SiteWorx home .. image:: /images/sw-databases-page.png :alt: database page #. Click the **Person** icon button next to the Database. The opens the User Permissions page .. image:: /images/sw-db-perms.png :alt: siteworx database add user permissions #. Click the **Trashcan** button next to the MySQL user. This opens the confirmation form .. image:: /images/sw-delete-db-perms.png :alt: siteworx database delete user permissions #. Click **Delete**