[Pdns-users] Trying to find a simple "how to" - pdnsutil secure-zone version

Brian Candler b.candler at pobox.com
Tue Apr 9 13:24:26 UTC 2019


On 09/04/2019 13:59, Edward Lewis wrote:
> I tried this command:
> zone2sql --named-conf=/path/to/named.conf --gmysql | mysql -u pdns -p pdns-db
>
> adjusting the "/path/to" first.  The pre--pipe command spit out what I'd expect.  The latter command complained about the -u (fixed that) and then the -p, but I don't know how to fix that.

I use mysql rather than mariadb, but they should be similar.  In mysql, 
the command breaks down as:

"-u pdns": the username to connect to the database as

"-p": prompt for password (or you can follow it immediately with a 
password, with no intervening space)

"pdns-db": the name of the database you want to connect to

So you need to know the creds the database was created with.  On Ubuntu, 
when you install mysql, you get a dialog asking to select a root 
database password.  Then you can connect with that (-u root -p), create 
a new database, create appropriate tables for powerdns, create another 
user/pass for powerdns, and grant access to pdns-db.* to that user.

The table creation info is here:

https://doc.powerdns.com/authoritative/guides/basic-database.html

As it says: "General MySQL knowledge is assumed".  But searching for 
"mysql create database" and "mysql grant privileges" should help.



More information about the Pdns-users mailing list