Edit view in phpMyAdmin

July 12th, 2011 § 1 comment § permalink

Are You a phpMyAdmin user? If so have you created views in it? I think most of you are. But phpMyAdmin doesn’t have a direct way to edit the views.
So what we do? Here is the easy steps to edit the MySQL-views in phpMyAdmin.This solution is just re-shared from the stackoverflow

Let our view name be “MySampleView”. Don’t forget to substitute your view name where ever you see “MySampleView”. 😉

    1. Run the Query SHOW CREATE VIEW MySampleView
    2. Click on the options just above the query result and change partial text to full text.
    3. Copy the content of create view column after “SQL SECURITY DEFINER VIEW `MySampleView` AS” and paste it in a query editor
    4. Make the changes you need for the view and run it.(Hope your desired output has came)
    5.  Now Scroll until you see create view after the query result and click on it
    6. You will be taken into the create view page.There you give your old view name ie.,MySampleView in the VIEW name field  and check in the OR REPLACE field.
    7. I hope the As textarea will be filled with your edited query if not please paste your new edited query
    8. Press GO to update the view.

Hooray. You have done it.