How to edit a MariaDB or MySQL database view using phpMyAdmin

This easy tutorial shows you how to edit a MariaDB/MySQL database view using phpMyAdmin on a cPanel account.

To edit a MariaDB/MySQL database view:

  1. Sign in to the Client Lounge.

  2. Click the cPanel button for your hosting account.

  3. In the Databases section, click phpMyAdmin.

  4. In the left column, select the desired database.

  5. In the top bar, select the tab named SQL.

  6. Enter the following: SHOW CREATE VIEW name_of_view where name_of_view is the exact name of the view that you wish to modify.

  7. Click the Go button.

  8. Click the Extra options button just below the SQL query.

  9. Select Full texts, then click Go.

  10. In the resulting table shown, you should see a column named Create View containing the SQL query that you’re wanting to modify.

    Copy and paste the entire portion of the SQL query after the first instance of the word AS, and paste it into your favorite text editor.

  11. Edit the pasted query in the text editor so that it matches what you need, then copy the new version of the query.

  12. Back in phpMyAdmin, click the SQL tab in the top bar and paste the new version of the query into the box, then click Go.

  13. Make sure the resulting table shows what you want the modified view to generate, then scroll to the very bottom of the page and click Create view.

  14. Make sure the resulting table shows what you want the modified view to generate, then scroll to the very bottom of the page and click Create view.

  15. Check the box at the top named OR REPLACE.

  16. In the View name field, enter the exact name of the view you are wanting to modify.

  17. Scroll to the bottom and click the Go button.

Your database view is now modified as desired!