MAXdev
Part 2 - Creating and Preparing the Database using phpMyAdmin
Duster

Part 2 - Creating and Preparing the Database using phpMyAdmin

The biggest problem many people have in installing MDPro is establishing the database connection. It is not enough to create the database. Proper access and usage permissions must be set for it. Some people will have databases created and access set up by their host. This information is primarily for those who have their own servers or virtual servers and may install their own programs, including MySQL, PHP and others. Some people on shared server hosting have a control panel that allows them to create databases. These instructions include them as well as people with their own servers.

This same information will apply to any MySQL databases, not just the one for MDPro. Thus, if you install a forum on your site that uses its own database or any other PHP/MySQL program, the same instructions will make setup easier for you with those other programs.

What you will be doing next is creating a database user name and assigning access privileges to the database for that user.

So as to minimize or eliminate confusion, where a word is to be entered in a field, it is shown here emboldened rather than in "quotation marks". This should eliminate any doubt about including the quotations marks (don't unless they are shown also).

Once you have installed phpMyAdmin and it is working properly, follow these steps to set up a database:

  1. At the phpMyAdmin main page, just under Create new database, enter the name of the database you wish to create and then click on Create. I suggest the default name of mdpro rather than any db names that include a version number. This can prevent confusion from having a database named after an older version while you are using a newer one that has had no database changes. The database name does not change as you upgrade your version of MDP so it makes no sense to include a version number as part of its name. There will never be any doubt or forgetting what program uses that database. If you expect to have multiple installations of MDP, you can preface it with a few initials to indicate its relationship to a particular site, such as dlmdpro, lpmdpro, etc., where the dl and lp are initials for the site names that correspond to their respective databases.
  2. At the phpMyAdmin main page, click on Privileges. You will be taken to the User Overview page. Click on Add a new User.
  3. Under Login Information, for User name enter the MDPro database user name in the field to the right. It may be the same as the server account name and that is a good choice. This same user may have access to other databases (such as forums). In the Host field, use the drop down menu to change the % sign to local. The field to the right will now show localhost (the usual value). In the field below, enter the password you wish to give use. This password is only for access to the MySQL database and is unrelated any other passwords you may have. Enter it again in the second password field. Skip the global privileges and click Go. Use a combination of alphanumeric characters and other allowed characters, vary the case, and make it impossible to be guessed. BigBob2 is a bad password. !52TuvX! is a good one. Once you have your password, write it down! Remember that your password is part of your account security!
  4. You are now taken to the Privileges page. Scroll down to the Database-specific privileges section. It says: Database-specific privileges, In the dropdown menu to the right that says text-field, select the name of the database you created in Step 1.
  5. Click on Privileges. Under database specific privileges, select a database and select SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP. Click on Go directly underneath the Database-specific privileges section.
  6. Click on Home and then Reload MySQL . This is essential for MySQL to recognize the changes you have made. Note that on some systems this does not work and the MySQL server must be stopped and then started to initialize the changes. We have completed our work with phpMyAdmin and setting up the database.
  7. Locate and open the config/md-config.php file as you will need to be familiar with the information in it. It must be a perfect match for the MySQL information. About half way down, you'll see a section that looks like this (except for the color instructions which you should follow)

    $pnconfig['dbtype'] = 'mysql'; do not change
    $pnconfig['dbtabletype'] = 'MyISAM'; do not change
    $pnconfig['dbhost'] = 'localhost'; do not change (unless your system calls for it)
    $pnconfig['dbuname'] = 'root'; change to the database user name you selected in step 3
    $pnconfig['dbpass'] = ''; enter the password you decided on and have written down
    $pnconfig['dbname'] = 'mdpro'; do not change unless you are doing multiple installations of MDPro (see step 1)
    $pnconfig['system'] = '0'; do not change
    $pnconfig['prefix'] = 'md'; do not change
    $pnconfig['encoded'] = '1'; do not change

    When you have finished editing the config.php file, keep it open in a window or write it down. The database name, database user name and password entered in MDP must match the information entered in the database or you will not be able to establish a connection. You will be shown some of this information and enter the rest later on in the installation process. By understanding it now it won't be confusing when you are asked for it later.

  8. If all goes well and no trouble shooting is involved, the hardest part is now over.

Note that the instructions above apply to setting up databases for other programs as well. However, some steps will not have to be repeated when adding other PHP/MySQL programs under the same user name.

Go to Part 3