Tech:Renaming a database

In case a database is created in mysql with a database name different to that on https://meta.orain.org/w/index.php?title=Database_list you should rename the database to match on either the wiki page or by renaming the database in mysql.

A common symptom of the database being incorrectly named is that the wiki will display a message showing "This is a cached copy of the requested page, and may not be up to date." (in red).

1. Show all databases
Identify the database that is incorrect / where we should be pointing.
 * 1) mysql -u mediawiki -p -e "show databases"

2. Renaming a mysql database
There is no simple way to do this in mysql.


 * 1) mysqldump -u mediawiki -p original_database > original_database.sql
 * 2) mysql -u mediawiki -p -e "create database my_new_database"
 * 3) mysql -u mediawiki -p my_new_database < original_database.sql

3. Tidy up

 * 1) Confirm the wiki now works
 * 2) mysql -u mediawiki -p -e drop database originl_database
 * 3) rm original_database.sql