twerple logo
Loading experience...
twerple logo

Database connection details for your website

1 min read • Updated 2 weeks ago • Databases

The host, port, database name and user to enter in WordPress, Laravel, PHP and other applications.


Your website needs four details to connect to its database. Use these values for any website hosted with Twerple.

SettingValue
Database hostlocalhost
Port3306 (most applications use it automatically)
Database namethe full name including the prefix, e.g. example_shop
Database userthe full user name including the prefix
Passwordthe password you set when you created the database

The database runs on the same server as your website, which is why the host is localhost. Do not use your domain or the server's IP address as the host for a website hosted with us.

Forgotten the password? Set a new one with Change Password next to the database in Databases → MySQL Databases, then update it in your website's settings.

WordPress (wp-config.php)

define( 'DB_NAME', 'example_shop' );
define( 'DB_USER', 'example_shop' );
define( 'DB_PASSWORD', 'your-password' );
define( 'DB_HOST', 'localhost' );

Laravel (.env)

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=example_shop
DB_USERNAME=example_shop
DB_PASSWORD=your-password

PHP (PDO)

$db = new PDO(
    'mysql:host=localhost;dbname=example_shop;charset=utf8mb4',
    'example_shop',
    'your-password'
);

Connecting from your own computer

To connect from a desktop tool such as MySQL Workbench or HeidiSQL, see Connecting to your database remotely.

Was this article helpful?