Create a MySQL Database Manually

Note

These are really detailed instructions that you can use if the ordinary installation instructions didn't work for you. If you're just starting, go there, not here.

When you create a database you need to keep track of four pieces of information that may be created during this process. They are:
- the database name
- the database host (usually: localhost)
- the database user
- the database user's password

After you have created the database following the instructions below, then you want to import the gRSShopper SQL code available here on GitHub.

When the database is created, these values need to be placed into grsshopper.pl - there is a place to put them right at the top of the file.

If you are using a hosting provider, there may be an automated setup solution to set up a new database. Check your hosting provider's support pages or your control panel for clues about whether or not you'll need to create one manually.

If you determine that you'll need to create one manually, follow the instructions for accessing phpMyAdmin on various servers, or follow the instructions for Using cPanel or Using phpMyAdmin below.

If you are installing gRSShopper on your own web server, follow the Using phpMyAdmin or Using the MySQL Client instructions below to create your gRSShopper username and database.

Using cPanel

If your hosting provider supplies the cPanel hosting control panel, you may follow these simple instructions to create your gRSShopper username and database. A more complete set of instructions for using cPanel to create the database and user can be found in Using cPanel.

- Log in to your cPanel.
- Click MySQL Database Wizard icon under the Databases section.
- In Step 1. Create a Database enter the database name and click Next Step.
- In Step 2. Create Database Users enter the database user name and the password. Make sure to use a strong password. Click Create User.
- In Step 3. Add User to Database click the All Privileges checkbox and click Next Step.
- In Step 4. Complete the task note the database name and user. Write down the values of hostname, username, databasename, and the password you chose. (Note that hostname will usually be localhost.)

Using phpMyAdmin

If your web server has phpMyAdmin installed, you may follow these instructions to create your gRSShopper username and database.

Note: These instructions are written for phpMyAdmin 2.6.0; the phpMyAdmin user interface can vary slightly between versions.

If a database relating to gRSShopper does not already exist in the Database dropdown on the left, create one:

- Choose a name for your gRSShopper database ('grsshoppers' or 'blog' are good), enter it in the Create new database field, and click Create.
- Click the Home icon in the upper left to return to the main page, then click Privileges. If a user relating to gRSShopper does not already exist in the list of users, create one:
-- Click Add a new User.
-- Chose a username for gRSShopper ('grsshopper' is good) and enter it in the User name field. (Be sure Use text field: is selected from the dropdown.)
-- Choose a difficult-to-guess password (ideally containing a combination of upper- and lower-case letters, numbers, and symbols), and enter it in the Password field. (Be sure Use text field: is selected from the dropdown.) Re-enter the password in the Re-type field.
-- Write down the username and password you chose.
-- Leave all options under Global privileges at their defaults.
-- Click Go.

Return to the Privileges screen and click the Check privileges icon on the user you've just created for WordPress. In the Database-specific privileges section, select the database you've just created for WordPress under the Add privileges to the following database dropdown. The page will refresh with privileges for that database. Click Check All to select all privileges, and click Go.

On the resulting page, make note of the host name listed after Server: at the top of the page. (This will usually be localhost.)

Using the MySQL Client

You can create MySQL users and databases quickly and easily by running mysql from the shell. The syntax is shown below and the dollar sign is the command prompt:

$ mysql -u adminusername -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5340 to server version: 3.23.54

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> CREATE DATABASE databasename;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON databasename.* TO "grsshopperusername"@"hostname" IDENTIFIED BY "password";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> EXIT
Bye
$

The example shows:

- that root is also the adminusername. It is a safer practice to choose a so-called "mortal" account as your mysql admin, so that you are not entering the command "mysql" as the root user on your system. (Any time you can avoid doing work as root you decrease your chance of being exploited). The name you use depends on the name you assigned as the database administrator using mysqladmin.
- grsshopper or blog are good values for databasename.
- grsshopper is a good value for grsshopperusername but you should realize that, since it is used here, the entire world will know it too.
- hostname will usually be localhost. If you don't know what this value should be, check with your system administrator if you are not the admin for your
gRSShopper host. If you are the system admin, consider using a non-root account to administer your database.
- password should be a difficult-to-guess password, ideally containing a combination of upper- and lower-case letters, numbers, and symbols. One good way of avoiding the use of a word found in a dictionary, uses the first letter of each word in a phrase that you find easy to remember.

If you need to write these values somewhere, avoid writing them in the system that contains the things protected by them. You need to remember the value used for databasename, grsshopperusername, hostname, and password. Of course, since they are already in (or will be, shortly) your grsshopper.pl file, there is no need to put them somewhere else, too.

Using Plesk

See: Plesk 7 at tamba2.org

Using DirectAdmin

a. Regular "User" of a single-site webhosting account logs in normally. Then click "MySQL Management." (If this is not readily visible, perhaps your host needs to modify your "package" to activate MySQL.) Then follow part "c" below.

b. "Reseller" accounts or "Admin" accounts may need to click "User Level." They also must first log-in as "Reseller" if the relevant domain is a Reseller's primary domain... or log-in as a "User" if the domain is not a Reseller's primary domain. If a Reseller's primary domain, then when logged-in as Reseller, you simply click "User Level." However if the relevant domain is not the Reseller's primary domain, then you must log-in as the relevant User. Then click "MySQL Management." (If not readily visible, perhaps you need to return to the Reseller or Admin level, and modify the "Manage user package" or "Manage Reseller package" to enable MySQL.)

c. In "MySQL Management," click on the small words: "Create new database." Here you are asked to submit two suffixes for the database and its username. For maximum security, use two different sets of 4-6 random characters. Then the password field has a "Random" button that generates an 8-character password. You may also add more characters to the password for maximum security. "Create." The next screen will summarize the database, username, password and hostname. Be sure to copy and paste these into a text file for future reference.

(Yes, I stole these instructions from the WordPress site located here. The process of creating a database for gRSShopper is exactly the same as for WordPress).