Not a developer? Go to MovableType.com

News

Database Setup Guide

By Byrne Reese
Posted May 31, 2007, in Getting Started.

Welcome to the Database Setup Guide, a component of Movable Type's Getting Started Guide. If you understand the fundamentals of setting up a database in which Movable Type can store its various tables and all of its data, you can skip this manual and proceed to the next section. Otherwise, this manual will help answer most questions about getting your database setup to run Movable Type.

This guide describes this process in generic as terms as possible, but is specifically geared towards support of a MySQL database.

Step One: Setup Your Server

If you do not have access to a database server or do not have one installed, then the first step is to install and/or setup a database. For most people, this should be relatively straight forward. If however, this is an intimidating process, then we encourage you to contact your company's IT department and ask for help. It is possible they already have a database that you can access and use for Movable Type. If you are using Movable Type for personal use then contact your hosting provider for help. All of these people will have more then enough experience with helping users such as yourself get up and running with a new database.

If you are comfortable with installing database software yourself, then we recommend using a package such a "yum" (available on CentOS, Fedora and Red Hat distributions) or "apt-get" (available on Debian and Ubuntu). To install mysql-server, you will need to be root when you run the following command:

    yum install mysql-server mysql

This process will typically install all that you need to run Movable Type on MySQL.

Rest assured that once you know that you have access to a database and have a username and password by which to access it, Movable Type will do the rest.

If you still need help setting up a database, then consult one of the following resources:

Step Two: Create a Database

Once you have your database server name and the username and password by which to access that server, then you are ready to create the physical database to store your information. If you are using MySQL this can be accomplished via the command line, or via a web tool such as MyPHPAdmin.

The command line method will be discussed below, but regardless of what method you use, you will ultimately need to "create a database" to store your blog's data. We recommend using a database name like "movabletypedb" or simply "movabletype" so that you can easily recognize it and find it later among other databases you may one day create.

Example: Creating a Database via the Command Line

If you are running MySQL and have access to a command line, or OS prompt, then the following instructions will help you get your database created.

    mysqladmin create -u <username> -p <database name>

Replace "<username>" with the username you use to access the database, and replace "<database name>" with "movabletype" or which ever name you wish to use for your database.

MySQL will then prompt you to enter a password. Enter the password associated with "". If everything works, then nothing will be printed to the screen. Go figure.
Back

7 Comments

Bud

Bud on July 26, 2007, 5:50 a.m. Reply

For what it’s worth, I think this is fine as a high level overview, but this is a great place for user-generated, detailed instructions by platform. Half the things I’ve figured out how to do in MT, I’ve figured out by reading someone’s blog post with lots of comments of people struggling through.

Roy on July 27, 2007, 12:01 p.m. Reply

Documentation like this is why I’m sticking with Wordpress.

Byrne Reese

Byrne Reese on July 27, 2007, 12:56 p.m. Reply

@Roy - Thank you for your feedback. It is always good for us to know the reasons behind people staying with, leaving or not switching to Movable Type. It is how we make the product better. With this release of MT we are doing everything we can to make sure people are heard, and that we respond with action not words (exclusively). I would really like to know what it was about this documentation didn’t work for you. We are working on a new installation guide which is a vast improvement over this document I wrote in all of 15 minutes six weeks ago. So it is not too late (it is never too late) to improve this documentation…

webmaster on July 28, 2007, 6:34 p.m. Reply

I tried to install MT at dreamhost.com using the following:

mysqladmin create -u -p

and I changed the parts like username and database name to what I wanted/needed to; however, I got the following errors:

mysqladmin: connect to server at ‘localhost’ failed error: ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysq ld.sock’ (2)’ Check that mysqld is running and that the socket: ‘/var/run/mysqld/mysqld.sock’ exists!

Any idea what I might need to do? Thanks

Su

Su on July 30, 2007, 7:55 p.m. Reply

For what it’s worth, I’m pretty sure that Dreamhost specifically does not allow using localhost. When you create a database(through the panel, anyway), it’ll end up on any of several different servers.

Kate

Kate on July 31, 2007, 4:55 a.m. Reply

@webmaster - Su is correct about DH and localhost. Also, DreamHost requires database (and host) creation from their control panel. You can only access the database from command line after it’s created. (http://wiki.dreamhost.com/MySQL)

Tim on August 4, 2007, 9:29 a.m. Reply

@kate and all: Specific to Dreamhost, you do not need to use the command line to access MySQL databases. Dreamhost automatically configures a utility called PHPMyAdmin that provides a browser-based interface to MySQL and your databases. In fact, you don’t need to interact with the command line at all when setting up and working with databases if Dreamhost is your ISP.

Byrne Reese

Byrne Reese was previously the Product Manager of Movable Type at Six Apart, where he had also held positions as the Manager of Platform Technology and Product Manager for TypePad. Byrne is a huge supporter of the Movable Type user and developer community. He dedicates much of his time to promoting and educating people about Movable Type as well as building the tools and plugins for Movable Type that are showcased on Majordojo. He contributes regularly to open source; and he is an advocate for open protocols and standards like Atom and OpenID.

Website: http://profile.typekey.com/byrnereese