glFusion Wiki

Site Tools


Creating the glFusion Database

glFusion requires a MySQL or MariaDB database.

To create a new database for your glFusion powered site, use the tools provided by your hosting provider. Generally, their Control Panel will have options to create a new database and to create the database user / password.

cPanel is a popular interface used by many hosting providers to allow you to administer your hosting account. Using cPanel, you can create the database, create the database user, assign the then assign the new user to your new database.

Many times when creating a database using phpMyAdmin or hosting wizards, the database character set defaults to Latin1. You will want to change the character set and collation to UTF-8 as shown below.

Creating the glFusion Database using cPanel

cPanel is a popular tool utilized by many hosting providers to allow you to manage your site and your hosting environment.

Login to cPanel

To create new database for your glFusion website, login to your Hosting Control Panel (cPanel). Type at your browser address bar

Select MySQL Database Wizard

In cPanel of your glFusion website scroll down and select MySQL Database Wizard from the Databases section

Create New Database

Enter the name for your database. Notice the name may be preceded by your hosting account name. Click the Next Step button. Note, on older versions of cPanel, the button may be labeled Create Database. This will create the database for your glFusion site.

Create New Database User

Enter a username and password to create the new database user account.

Select All Privileges

Set All Privileges to your user for glFusion database and click Next Step.

After clicking “Next Step” button, your user will be connected to your newly created glFusion database and you can now start the glFusion installation process.

Be sure to write down the database name and database username / password. You will need to enter this information during the glFusion installation.

Validate the Database Character Set / Collation

Many times when using the cPanel Database Wizard, the database is created with the latin1 collation. We want to make sure to change the database to use the utf8mb4 collation. See Changing the Database Collation section below for details on how to validate / change the database collation.

Creating a database using phpMyAdmin

phpMyAdmin is a web based graphical user interface for creating and managing MySQL databases.

Log into phpMyAdmin

To create new database for your glFusion website, login to phpMyAdmin. Many hosting providers offer access to phpMyAdmin via the control panel.

Create the Database

Once logged in, click on the Database Tab. Enter the database name in the Create new database field and select utf8mb4_unicode_ci from the Collation dropdown. Click the Create button.

Create A New User

Create a new username and password to be used by glFusion to access the newly created MySQL database. To do so navigate to the Privileges Tab and click on Add a new user.

In the Add new user page shown above, enter a username and password, and ignore all other entries. Ensure the hostname is set to Any Host with a percent sign (%) in the input field. This will allow the user to connect from all hosts.

Ensure the checkbox for Grant all privileges on database “DATABASENAME” is checked. The DATABASENAME will be the name of the database we created earlier in the process.

Click the Go button on the bottom of the page.

This will create the user and grant all privileges to the glFusion database. The following screen will be shown:

Ensure all checkboxes are checked, with the exception of the Grant permission. Grant is not needed for glFusion to operate. All other permissions must be set.

Creating a database using the Command Line Tools

If running mysql from the command line, be sure to start mysql with utf8 character set:

  mysql --default-character-set=utf8 -u ROOTUSER -p

Replace ROOTUSER with a user account that has full admin rights in MySQL. The -p will prompt you for the database password for this user.

To create a database with UTF8MB4 Character set and UTF8MB4 collation, use the following SQL:

    CHARACTER SET utf8mb4
    COLLATE utf8mb4_unicode_ci;

Once the database is created, use the command GRANT ALL PRIVILEGES to create a new user with ALL privileges. If the database name is glfusion, the new user is glfuser and the user’s passwords is !6aYeBw98? then the command should be;

GRANT ALL PRIVILEGES ON glfusion.* TO "glfuser"@"localhost" IDENTIFIED BY "!6aYeBw98?";

Required Database Permissions

When creating your new glFusion database, you may be asked some technical questions about the privileges the database user should have and what encoding to use for your database. The database user should have the following privileges or permissions for the glFusion database:

  • DROP

Database Character Set / Collation

glFusion defaults to using the UTF8 collation for it's database. It is recommended that you use utf8_unicode_ci as the database collation. If you are running a recent release of MySQL that supports utf8mb4_unicode_ci, this would be the recommended option.

Changing Database Character Set / Collation in phpMyAdmin

My hosting providers offer access to phpMyAdmin to manage your MySQL or MariaDB databases. You can use phpMyAdmin to easily change the character set / collation of a database.

You generally do not want to change the database collation on a database that already has data in it. This should only be performed on new and empty databases.

Log into phpMyAdmin

How you access phpMyAdmin is generally through your host's control panel. If you do not see a link to phpMyAdmin, check with your host's technical support team.

Select the Database

From the list of databases on the left navigation, select your glFusion database.

Change the Collation

Select the Operations button from the top navigation. This will present you with a screen with several options. We want to find the Collation panel. From the dropdown in the Collation panel, select utf8mb4_unicode_ci. If the utf8mb4 options are not available, then choose utf8_unicode_ci.

Click the Go button and this will change the database collation to UTF-8. You are now ready to start your glFusion installation.

glfusion/installation/database.txt · Last modified: 2017/02/11 13:22 (external edit)

Page Tools