feat: implement MariaDbOperationService for database management and add MariaDB configuration template
This commit is contained in:
@@ -103,7 +103,7 @@ export class MariaDbOperationService {
|
||||
|
||||
async createDatabaseAndUser(config: MariaDbConfig, dbName: string, user: string, pass: string): Promise<{ success: boolean; message: string }> {
|
||||
const queries = [
|
||||
`CREATE DATABASE IF NOT EXISTS \`${dbName}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;`,
|
||||
`CREATE DATABASE IF NOT EXISTS \`${dbName}\` CHARACTER SET utf8 COLLATE utf8_unicode_ci;`,
|
||||
`CREATE USER IF NOT EXISTS '${user}'@'%' IDENTIFIED BY '${pass}';`,
|
||||
`GRANT ALL PRIVILEGES ON \`${dbName}\`.* TO '${user}'@'%';`,
|
||||
`FLUSH PRIVILEGES;`
|
||||
|
||||
Reference in New Issue
Block a user