On 05-18-2021 9:31 am, Maurizio Caloro wrote:
Installed Mysql on debian 10.9 and will ask you friendly to receive the 5
command to create this db on my mysql sever.

Please I don't know the command's and I don't found or see any nice example.

Postfix wont have any examples because it is something you do in sql/mysql, there are many ways, and each database does it different. They assume you know how to use databases.

MySql documentation can be found here:
https://dev.mysql.com/doc/refman/8.0/en/creating-tables.html

But you can google more friendly examples, for example:
https://www.w3schools.com/mysql/mysql_create_table.asp

You have to first decide your table structure, only you will know everything you will want in the database. Setting up databases with postfix is not for the casual tutorial copy/paste development.


virtual_mailbox_domains =        mysql:
/etc/postfix/mysql-virtual_mailbox_domains.cf

mysql-virtual_mailbox_domains.cf
                username, password, DBName, host
                SELECT domain FROM domain WHERE domain = '%s'

Here is an example of one way for your setup:

main.cf:
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf

mysql-virtual_mailbox_domains.cf:
hosts = unix:/var/lib/mysql/mysql.sock
dbname = <your database name>
user = <db user name>
password = <password>
require_result_set = no
query = SELECT domainName FROM domains WHERE domainName='%s' LIMIT 1

MySQL Commands:
CREATE DATABASE <your database name>;
CREATE TABLE domains (domainName VARCHAR(50) NOT NULL PRIMARY KEY);
INSERT INTO domains SET domainName = 'example.com';

Reply via email to