» » » » » » » WordPress installation – Database

WordPress installation – Database

posted in: Installation | 0

Step 1: Download and extract

Download and unzip the WordPress archive.

  • If you intend to upload WordPress on a remote web server, download the WordPress archive on your computer with your favorite web browser and unzip it.
  • If you have shell access on your web server, and you master using command-line tools, you can consider to download WordPress directly to your web server using wget (or lynx or any other web browser command line) if you want to avoid the transfer via FTP.

The WordPress archive decompress in a folder called wordpress in the same directory where you downloaded it.

Step 2: Create a database and a user

If you are customer of a host, you probably already have a WordPress database ready for you, or there must be automatic configuration solutions. See the support pages of your provider or your control panel about whether or not you need to create one manually.

If you consider that you need to create one manually, follow the instructions for accessing phpMyAdmin on many servers or to use your control panel or phpMyAdmin as below.

If you installed WordPress on your own web server, follow the instructions on the use of phpMyAdmin or MySQL client below to create your database and your user name of WordPress.

Using cPanel

Cpanel-Database-Create

If your host uses cPanel, you can follow these instructions to create your database and your user name of WordPress.

  1. Log in to your cPanel
  2. Click on MySQL Databases
  3. If a user relating to WordPress does not already exist in the Current Users section, create one:
    1. Choose a username for WordPress (‘wordpress‘ is quite suitable) and enter it in the Username field
    2. Choose a password difficult to guess (ideally containing a combination of uppercase, lowercase, numbers and symbols) and enter it in the Password and Password (Again) fields
    3. Keep this information in a safe place
    4. Click Create User.
  4. If on WordPress database does not yet exist in the Current Databases section, create one:
    1. Choose a name for your WordPress database (‘wordpress‘ or ‘blog‘ are good choices), enter it in the field New Database and click Create Database.
  5. In Add User To Database, select your WordPress username from the dropdown User list and your database from the dropdown Database list. Click Add. Make sure that all boxes are checked in the ALL PRIVILEGES section, and then click Make Changes.
  6. Once back to the main screen of MySQL Databases cPanel will display information about the database you just created. You should see the username you just added to the database (with ALL PRIVILEGES)

Keep in a safe place the values ​​of the host name, user name, the database and the password you chose (Note that hostname will usually be localhost).

Using phpMyAdmin

Wordpress-phpMyAdmin

If phpMyAdmin is installed on your web server, you must follow these instructions to create your database and your user name of WordPress.

Note: These instructions are written for phpMyAdmin 2.6.0; the user interface may vary slightly from one version to another.

  1. If a database relating to WordPress does not already exist in the combo Database on the left, create one:
    1. Choose a name for your WordPress database (‘wordpress‘ or ‘blog‘ are possibilities), enter it in the Create a new database and click Create.
  2. Click on the Home icon on the upper left to return to the main page, then click Privileges. If a user relating to WordPress does not already exist in the list of users, create one:
    1. Click Add a New User
    2. Choose a username for WordPress (‘wordpress‘ is a good choice) and enter it in the chmap User name (make sure Use text field is selected in the drop down list).
    3. Choose a difficult to guess password (ideally containing a combination uppercase and lowercase letters, numbers and symbols), and enter it in the Password field (make sure Use text field is selected in the list). Re-enter the password in the field Re-type.
    4. Keep in a safe place the user name and the password you chose.
    5. Leave all options in the Global privileges section to their default value.
    6. Click the Go button.
  3. Return to the Privileges screen and click the icon Check privileges for the user that you just created for WordPress. In the Privileges section specific to a database (Database-specific privileges), select the database you just created for WordPress in the combo. Add privileges on the database (Add privileges to the following database). The page will refresh the privileges for that database. Click Check all to select all privileges, and click Go.
  4. On the next page, identify the host name listed after Server: top (this will probably localhost).

Using MySQL Client

If you have shell access of your web server, and you master the use of the command line, and you have enough permissions to create databases and MySQL users, you can follow the example below to create your database and your user name of WordPress.

[php] $ 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 "wordpressusername"@"host"
-> 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
$
[/php]

In the example above:

  • adminusername should be root, unless you have other superior users.
  • wordpress or blog are good values for databasename.
  • wordpress is a good choice for wordpressusername.
  • The host is usually localhost. If you do not know this value, consult your system administrator. If you are the system administrator, you must have this value in your possession.
  • It is advised that password is a password difficult to guess, ideally containing a combination of uppercase and lowercase letters, numbers and symbols.

Keep in a safe place the values you used for databasename, wordpressusername, host and password.

Translated from WordPress.org

Leave a Reply

Your email address will not be published. Required fields are marked *