mysql 5.5 search and replace deprecated syntax

dfoxx

Member
Feb 1, 2010
8
0
51
Hello,

Could someone please post the command to search all files in all /home/*/public_html folders
for TYPE=MyISAM so that it gets replaced with ENGINE=MyISAM because TYPE=MyISAM is deprecated.

Could there be a script developed so that all deprecated functions are replaced by the correct syntax ?

Best Regards,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Hello :)

This command may be helpful:

Code:
grep -H -r "TYPE=MyISAM" /home/
This would output all files in /home that use "TYPE=MyISAM" within the file contents.

Thank you.
 

dfoxx

Member
Feb 1, 2010
8
0
51
What is the difference between the two commands ?
Are the commands capital letter sensitive ?

Is it also possible to automatically change TYPE=MyISAM" to ENGINE=MyISAM" ?
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
You can review the differences between the various flags used with "grep" by running the following command:

Code:
man grep
Both commands provided are case sensitive. You can add the "-i" flag so it will include all matches:

Code:
grep -H -r -i "TYPE=MyISAM" /home/
I do not recommend automatically replacing the entry in every file because you risk incorrectly modifying the files if you are not comfortable on the command line. However, you could develop a custom "replace" command if necessary.

Thank you.