Created
August 22, 2012 06:14
-
-
Save gjedeer/3422797 to your computer and use it in GitHub Desktop.
Mass-change database prefixes in Joomla!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# mass change prefixes in Joomla database | |
# massivescale.net 2012 | |
# | |
echo "SELECT concat('rename table ', table_name, ' to ', 'iddqd', substr(table_name,4), ';') FROM information_schema.tables WHERE table_name like 'jos%';" | mysql | tail -n +2 | mysql `grep db\ /var/www/configuration.php | awk -F"'" '{print $2}'` | |
sed -i -e 's/jos_/iddqd_/' /var/www/configuration.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment