Plesk makes it easy to create MySQL databases and database users for your website or application. This guide covers creating databases, setting up database users, and managing access permissions.

Creating a Database

  1. Log in to Plesk.
  2. Go to Databases in the left navigation menu.
  3. Click Add Database.
  4. Fill in the required fields:
    • Database name: Enter a name for the database (e.g., mywebsite_db). A prefix will be added automatically.
    • Related site: Select the domain this database is associated with (optional but recommended).
    • Database server: Select the database server (usually MySQL or localhost).
    • Database user: Create a new user for this database. Enter a username and a strong password.
    • Access control: Choose whether this user can access all databases on the account or only this specific database.
    • Character set: Select UTF-8 (utf8mb4) unless your application requires a different character set.
  5. Click OK to create the database and user.

Adding a User to an Existing Database

  1. Go to Databases.
  2. Click the database name you want to modify.
  3. Go to the Users tab.
  4. Click Add Database User.
  5. Enter the username and password.
  6. Click OK.

Viewing Database Connection Details

  1. Go to Databases.
  2. Click the database name.
  3. Click Connection Info.
  4. You will see:
    • Host: The database server address (usually localhost).
    • Port: The MySQL port (usually 3306).
    • Database name: The full database name (including prefix).
    • Username: The full database username (including prefix).

Important Notes

  • Plesk automatically adds a prefix to database names and usernames (based on your account).
  • The number of databases you can create may be limited by your hosting plan.
  • Always use utf8mb4 character set for modern applications to support all characters including emojis.

Troubleshooting

"Cannot create database — limit reached":

  • Contact your hosting provider to increase your database limit or upgrade your plan.

Application cannot connect to the database:

  • Verify the connection details in DatabasesConnection Info.
  • Ensure the database user has access to the correct database.
Was this answer helpful? 0 Users Found This Useful (0 Votes)