WordPress.org

Ready to get started?Download WordPress

Forums

Rename MySQL Database? (8 posts)

  1. msmeritt
    Member
    Posted 6 years ago #

    I so far run a single site with WordPress. I am now about to start adding multiple new WP-driven sites using addon domains within my hosting account. I hadn't anticipated that when I installed my first WP-driven site, and I gave that first MySQL database a name that I'd now prefer to change. If I can't change it, I'll live. But if it's possible to change it while preserving all functionality in that WP installation, I'd like to. Is it possible? If so, how?

  2. MichaelH
    Member
    Posted 6 years ago #

    Assuming you can change the database name (not to be confused with database TABLE names), then after you change it you should be able to edit wp-config.php and use that new database name and WordPRess should work.

    Also see:
    Installing Multiple Blogs

  3. moshu
    Member
    Posted 6 years ago #

    Just out of curiousity... since nobody knows what the name of your database is - why does it matter?

  4. msmeritt
    Member
    Posted 6 years ago #

    It matters only for my management of what will soon be multiple database, one for each of various sites that I'll be running all within a single hosting account.

    I was referring to the whole database name, not any particular tables. Nice to know that it should be as simple on the WP end as updating the config file. Question, then, seems to be whether it is possible to actually rename the database. I don't see an option for that in cPanel. I guess this becomes a cPanel/hosting support question and perhaps no longer appropriate to discuss here?

  5. Tdude
    Member
    Posted 6 years ago #

    Hi!
    ThereĀ“s plenty of freeware for hooking up to a MySQL db if you need it (I'm using CocoaMySQL for Mac and it works great of course) Most hosts have an online app that you could use.
    I don't see any problems with changing the db name for wp. The wp-config file even says: "// You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!"

    Happy coding,
    /T

  6. whooami
    Member
    Posted 6 years ago #

    @msmeritt

    if you have cpanel available, chances are you have phpmyadmin available as well.

    http://www.tamba2.org.uk/wordpress/phpmyadmin2/ has some images that might help you know what you are looking for.

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    If you're using MySQL 5.1.7 or higher, it's easy to do.
    http://dev.mysql.com/doc/refman/5.1/en/rename-database.html

    If not, then you'll have to shutdown MySQL and rename the directory that holds the database.

    Alternate method: Export the whole database, edit the export file to change all the database name references (if any are in there, not sure), import the tables back into a new database.

  8. msmeritt
    Member
    Posted 6 years ago #

    Thanks to all for the help. I'll see what I can do with these suggestions.

Topic Closed

This topic has been closed to new replies.

About this Topic