Why DROP INDEX IF EXISTS generates a MySQL note
This is what I have founded here: https://mariadb.com/kb/en/drop-index/
If the IF EXISTS clause is used, then MariaDB will return a warning
instead of an error if the index does not exist.
Hope this helps.
Determining if MySQL table index exists before creating
SELECT INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE
`TABLE_CATALOG` = 'def' AND `TABLE_SCHEMA` = DATABASE() AND
`TABLE_NAME` = theTable AND `INDEX_NAME` = theIndexName
What happens if I drop a MySQL column without dropping its index first?
According to the MySQL 5.1 Reference Manual:
If columns are dropped from a table,
the columns are also removed from any
index of which they are a part. If all
columns that make up an index are
dropped, the index is dropped as well.
If you use CHANGE or MODIFY to shorten
a column for which an index exists on
the column, and the resulting column
length is less than the index length,
MySQL shortens the index
automatically.
How to check if an index exists on a table field in MySQL
Use SHOW INDEX
like so:
SHOW INDEX FROM [tablename]
Docs: https://dev.mysql.com/doc/refman/5.0/en/show-index.html
Related Topics
How to Detect If Have to Apply Utf-8 Decode or Encode on a String
How to Get Values Inside <![Cdata[Values]] > Using PHP Dom
How to Set Current Page "Active" in PHP
Remotely Connecting to a MySQL Database
How to Send Email with Smtp in PHP
Warning: MySQLi_Real_Escape_String() Expects Exactly 2 Parameters, 1 Given... What I Do Wrong
PHP & MySQL: When Exactly to Use HTMLentities
Copy File from Remote Server or Url
How to Send Cookies with File_Get_Contents
PHP Soap Client for Uk Mail Webservice API
Fatal Error: Call to a Member Function Query() on Null