Howto change mysql view in phpmyadmin

In SQL, View performs the notable role by storing complicated SQL query into a virtual table. In other words, SQL View is stored/saved SQL query. Many users scrabbled while updating/editing the view. Reason is simple, there is no single click option available on screen to do so.

To change or modify the view, follow the below steps.

  1. Open phpMyAdmin (i.e. from cPanel > Databases)
  2. Select Database
  3. Click on SQL Tab (see below screenshot)
  4. Type SHOW CREATE VIEW view_name

    Edit-Update SQL View

    phpMyAdmin

  5. Click on link  Print view (with full texts)

    Print View Full phpMyAdmin

    Print View (with full text) link in phpMyAdmin

  6. Select the SQL query from Create View Column immediately after the word “AS” and copy it.

    View MySQL

    Select query afterword ‘AS’

  7. Paste the copied query in a safe place (i.e. use Notepad)
  8. Delete the view by typing DROP VIEW view_name in SQL tab
  9. Now, return to SQL tab
  10. Paste the previously copied query and hit on the ‘Go’  button
  11. Click on link Create View located at the below right corner

    create-view-phpmyadmin-mysql

    Create View

  12. Give View name and click on ‘Go’ button
  13. Done!

In this way, you can update/edit your MySQL view in phpMyAdmin. If you know/found any other solution then please share via comments. It would be helpful to the new pathfinder.

source

Leave a Comment

Your email address will not be published. Required fields are marked *