Skip to content

Database Setup

Configure databases for nopCommerce deployment.

SQL Server

Connection String Format

Data Source=server;Initial Catalog=nopCommerce;User Id=user;Password=pass;Trust Server Certificate=True

Create Database

sql
CREATE DATABASE nopCommerce;
GO

CREATE LOGIN nopuser WITH PASSWORD = 'YourPassword123!';
GO

USE nopCommerce;
CREATE USER nopuser FOR LOGIN nopuser;
EXEC sp_addrolemember 'db_owner', 'nopuser';
GO

MySQL

Connection String

Server=localhost;Database=nopcommerce;Uid=nopuser;Pwd=password;

Create Database

sql
CREATE DATABASE nopcommerce CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'nopuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON nopcommerce.* TO 'nopuser'@'localhost';
FLUSH PRIVILEGES;

PostgreSQL

Connection String

Host=localhost;Database=nopcommerce;Username=nopuser;Password=password

Create Database

sql
CREATE DATABASE nopcommerce;
CREATE USER nopuser WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE nopcommerce TO nopuser;

Installation

  1. Run nopCommerce and complete installation wizard
  2. Select your database provider
  3. Enter connection string
  4. Database schema is created automatically

Backup Recommendations

  • Daily automated backups
  • Keep 7-30 days of backups
  • Test restore process regularly
  • Store backups offsite

Released under the nopCommerce Public License.