Edit and update MySQL view in phpMyAdmin

  • Reading time:2 min(s) read
  • Post last modified:October 11, 2020
  • Post author:
Edit and update 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.

Method A: For phpMyAdmin (ver 4.x +)

  1.  Click on Views > Structure of respective table
    phpMyAdmin View Structure
  2.  Click on Edit view
    phpMyAdmin - Edit View
  3. Now edit the View query as you wish
    phpmyadmin edit view

Hope, it will helpful to you to edit view in phpMyAdmin. Last but not least, thanks to Mr John Horton who is given idea about this for new version of phpMyAdmin.

Method B: For old phpMyAdmin (ver < 3.x)

  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
  • Click on link  Print view (with full texts)
  • Print View Full phpMyAdmin
    Print View (with full text) link in phpMyAdmin
  • Select the SQL query from Create View Column immediately after the word “AS” and copy it.
  • View MySQL
    Select query afterword ‘AS’
  • Paste the copied query in a safe place (i.e. use Notepad)
  • Delete the view by typing DROP VIEW view_name in SQL tab
  • Now, return to SQL tab
  • Paste the previously copied query and hit on the ‘Go’  button
  • Click on link Create View located at the below right corner
  • create-view-phpmyadmin-mysql
    Create View
  • Give View name and click on ‘Go’ button
  • 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.

    This Post Has 8 Comments

    1. John Horton

      There is a much easier way than this.

      1. Click database.
      2. Click view.
      3. Click Structure tab
      4. Scroll to near bottom and click on Edit View under Check All

      1. Lucky Bhumkar

        Thank you very much John Horton sir. Your solution added into the post.

    2. Solution Seeker

      Ha, thank you John Horton!

    3. hman

      On 4.6.6deb4 there is no Edit View under Check All on Structure…

    4. Murugesan R

      Your post helped. I thank you very much. I appreciate your service.

    5. Devdever

      very good

    Leave a Reply