You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prisma MariaDB Adapter Times Out With “pool timeout” When Underlying MariaDB Authentication Fails #28879
yes i m sure there is definitely issue with maria-db adapter. because i also face connection timeout issue . it happens after i start the app and executing queries.
Reacted by manojsinghindiit, azhezzzz, Shinji Yamada, YC.W, rynu221 and Agung
I encountered the same issue. First, I configured the logger/log options to print intermediate logs, which then revealed the actual cause of the connection failure. After that, I was able to resolve the issue. The problem I faced was "ip host is blocked".
import { Injectable, OnModuleDestroy, Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { PrismaMariaDb } from '@prisma/adapter-mariadb';
import { PrismaClient } from '@/generated/prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleDestroy {
// Built-in NestJS logger instance for PrismaService
private readonly logger = new Logger(PrismaService.name);
constructor(configService: ConfigService) {
const adapter = new PrismaMariaDb({
connectionLimit: Number(configService.getOrThrow('DB_CONNECTION_LIMIT')),
database: configService.getOrThrow('DB_DATABASE'),
host: configService.getOrThrow('DB_HOST'),
password: configService.getOrThrow('DB_PASSWORD'),
user: configService.getOrThrow('DB_USER'),
// Prisma adapter logger configuration
logger: {
network: (info) => {
this.logger.log('PrismaAdapterNetwork', info);
},
query: (info) => {
this.logger.log('PrismaAdapterQuery', info);
},
error: (error) => {
this.logger.error('PrismaAdapterError', error);
},
warning: (info) => {
this.logger.warn('PrismaAdapterWarning', info);
},
},
});
// Prisma client initialization with adapter and full log levels
super({
adapter,
log: ['query', 'info', 'warn', 'error'],
});
}
// Connect to database when module is initialized
async onModuleInit() {
await this.$connect();
this.logger.log('Database connection succeeded');
}
// Disconnect from database when module is destroyed
async onModuleDestroy() {
await this.$disconnect();
this.logger.log('Database connection disconnected');
}
}
Reacted by manojsinghindiit, Technoaux6 and Syed Ahmed Ali
Activity
Ashkumar7 commentedon Dec 8, 2025
yes i m sure there is definitely issue with maria-db adapter. because i also face connection timeout issue . it happens after i start the app and executing queries.
yc-w-cn commentedon Dec 10, 2025
I encountered the same issue. First, I configured the logger/log options to print intermediate logs, which then revealed the actual cause of the connection failure. After that, I was able to resolve the issue. The problem I faced was "ip host is blocked".
jacek-prisma commentedon Dec 11, 2025
Closing as a duplicate
HafizSyedAhmedAli commentedon May 9, 2026
Thank you this worked i had to add allowPublicKeyRetrieval: true, in the adapter options
surajprasad13 commentedon Sep 23, 2026
This worked for me as well thanks