The Movable Type Knowledge Base

Create MySQL Database Using CPanel

Question

I have a MySQL database available on my server, and my hosting account uses CPanel. How can I set up my database?

Answer

If your host uses CPanel for your site management, you can use this visual interface to create the database.

  • Log into your CPanel (typically located at http://www.example.com/cpanel for your domain).

  • Look for the option to work with databases - it may read Manage MySQL in the Databases box.

  • Scroll down to where it says: Db: _________ [add]

    • Enter your preferred database name.
    • Click Add.

    This will create a database in the format of account_databasename, where account is your username with your host, and databasename is the name you've chosen for your database.

  • Now scroll down to where it says Users.

    • Enter your preferred username and password.
    • Click Add User.

    This will create a username in the format of account_username, where account is your username with your host, and username is the username you have just created for your new database.

  • Now scroll back up to locate the two drop down boxes with a button that says [Add User to Db]

    • In the drop down select box on the left, choose your newly created username, and in the box on the right, choose your newly created database.
    • Check "All" for Privileges.
    • Click Add User to Db.

Now your MySQL database is set up, but you still need to configure Movable Type to use it.

  • Download your existing mt-config.cgi1 file from your Movable Type directory on your server in ASCII mode, and open it in a plain text editor. (If this is the first time you're configuring Movable Type, consult the Installation Instructions for more information on this file.) Add the following lines:

    ObjectDriver DBI::mysql
    Database account_databasename
    DBUser account_username
    DBPassword database_password

    replacing account_databasename, account_username, and database_password2 with the appropriate values in your case.

  • If you're using the existing lines in mt-config.cgi rather than adding new ones, make sure you've uncommented3 each setting so the system will not ignore it.

  • Save mt-config.cgi and upload back to your server in ASCII mode.

1 In versions prior to 3.2, the configuration file is named mt.cfg.

2 In versions prior to 3.2, the password is set separately in mt-db-pass.cgi.

3 To uncomment a setting means to remove the # from the beginning of the line where it appears.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.