Difference between revisions of "Rename a MediaWiki database"

From Organic Design wiki
m
Line 22: Line 22:
 
}}
 
}}
  
 +
In the [[LocalSettings.php]] file, the global
 +
{{code|<PHP>
 +
$wgDBname              = "od";
 +
</PHP>
 +
}}
 +
 +
may need to be changed to point to the new database. Privileges may also need to be set in the '''db''' table in the '''mysql''' permissions database.
 +
 
[[Category:Installation]]
 
[[Category:Installation]]

Revision as of 09:31, 18 November 2008

Procedure.svg Rename a MediaWiki database
Organic Design procedure

The simplest approach is to take a sql dump of a database;


{{{1}}}

and manually edit the line in backupfile.sql

CREATE DATABASE /*!32312 IF NOT EXISTS*/ [database]

then restore the mysqldump file with;


<PHP>

mysql -u [user] -p [database] < backupfile.sql # Restore </PHP>

In the LocalSettings.php file, the global

{{{1}}}

may need to be changed to point to the new database. Privileges may also need to be set in the db table in the mysql permissions database.