SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Feb 10, 2009, 16:42 #1
- Join Date
- Feb 2007
- Location
- Southern California
- Posts
- 1,388
- Mentioned
- 1 Post(s)
- Tagged
- 1 Thread(s)
What query to remove index on fields?
I accidentally create a second index on several fields, not realizing that I already had such an index. PHPMyAdmin showed me my error. What is the query that removes an index?
Thanks!
-
Feb 10, 2009, 18:31 #2
- Join Date
- Aug 2007
- Posts
- 566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Feb 11, 2009, 09:26 #3
- Join Date
- Feb 2007
- Location
- Southern California
- Posts
- 1,388
- Mentioned
- 1 Post(s)
- Tagged
- 1 Thread(s)
Thank you very much!
-
Feb 11, 2009, 09:38 #4
- Join Date
- Feb 2007
- Location
- Southern California
- Posts
- 1,388
- Mentioned
- 1 Post(s)
- Tagged
- 1 Thread(s)
I used PHPMyAdmin to create the index. I checked each column for which I wanted included in the index, then clicked on the Index button. I notice that to drop an index, one specifies the name of the index:
DROP INDEX index_name ON tbl_name
I did not give a name to any of my indexes (PHPMyAdmin did not prompt for one). How do I drop an unnamed index? Using * in place of the name did not work.
Thanks.
-
Feb 11, 2009, 10:52 #5
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
run the following query in the SQL tab:
Code:SHOW CREATE TABLE tablename
-
Feb 11, 2009, 12:09 #6
- Join Date
- Feb 2007
- Location
- Southern California
- Posts
- 1,388
- Mentioned
- 1 Post(s)
- Tagged
- 1 Thread(s)
Great! That solved my problem. Another scrap of code to add to my cheat sheet!
Thanks,
Steve
Bookmarks