[Pdns-users] [Ext] Re: Trying to find a simple "how to" - pdnsutil secure-zone version
Edward Lewis
edward.lewis at icann.org
Tue Apr 9 18:03:19 UTC 2019
> As it says: "General MySQL knowledge is assumed". But searching for "mysql create database" and "mysql grant privileges" should help.
Coming at this as a complete novice in databases, it would help if the PowerDNS instructions had a pointer. (I know it isn't the job to teach me databases, but I'm just trying to exercise the DNS functions associated with PowerDNS.)
For 'mysql create database' I was led to do this:
# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 47
Server version: 10.0.38-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
...and then lifting from the page:
https://docs.powerdns.com/authoritative/guides/basic-database.html
MariaDB [(none)]> CREATE TABLE domains (
-> id INT AUTO_INCREMENT,
-> name VARCHAR(255) NOT NULL,
-> master VARCHAR(128) DEFAULT NULL,
-> last_check INT DEFAULT NULL,
-> type VARCHAR(6) NOT NULL,
-> notified_serial INT UNSIGNED DEFAULT NULL,
-> account VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
-> PRIMARY KEY (id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
...It seems I'm missing some sort of a SELECT statement...
MariaDB [(none)]>
MariaDB [(none)]> CREATE UNIQUE INDEX name_index ON domains(name);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE records (
-> id BIGINT AUTO_INCREMENT,
-> domain_id INT DEFAULT NULL,
-> name VARCHAR(255) DEFAULT NULL,
-> type VARCHAR(10) DEFAULT NULL,
-> content VARCHAR(64000) DEFAULT NULL,
-> ttl INT DEFAULT NULL,
-> prio INT DEFAULT NULL,
-> disabled TINYINT(1) DEFAULT 0,
-> ordername VARCHAR(255) BINARY DEFAULT NULL,
-> auth TINYINT(1) DEFAULT 1,
-> PRIMARY KEY (id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]> CREATE INDEX nametype_index ON records(name,type);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> CREATE INDEX domain_id ON records(domain_id);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> CREATE INDEX ordername ON records (ordername);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE supermasters (
-> ip VARCHAR(64) NOT NULL,
-> nameserver VARCHAR(255) NOT NULL,
-> account VARCHAR(40) CHARACTER SET 'utf8' NOT NULL,
-> PRIMARY KEY (ip, nameserver)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE comments (
-> id INT AUTO_INCREMENT,
-> domain_id INT NOT NULL,
-> name VARCHAR(255) NOT NULL,
-> type VARCHAR(10) NOT NULL,
-> modified_at INT NOT NULL,
-> account VARCHAR(40) CHARACTER SET 'utf8' DEFAULT NULL,
-> comment TEXT CHARACTER SET 'utf8' NOT NULL,
-> PRIMARY KEY (id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]> CREATE INDEX comments_name_type_idx ON comments (name, type);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE domainmetadata (
-> id INT AUTO_INCREMENT,
-> domain_id INT NOT NULL,
-> kind VARCHAR(32),
-> content TEXT,
-> PRIMARY KEY (id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]> CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE cryptokeys (
-> id INT AUTO_INCREMENT,
-> domain_id INT NOT NULL,
-> flags INT NOT NULL,
-> active BOOL,
-> content TEXT,
-> PRIMARY KEY(id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]> CREATE INDEX domainidindex ON cryptokeys(domain_id);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
MariaDB [(none)]> CREATE TABLE tsigkeys (
-> id INT AUTO_INCREMENT,
-> name VARCHAR(255),
-> algorithm VARCHAR(50),
-> secret VARCHAR(255),
-> PRIMARY KEY (id)
-> ) Engine=InnoDB CHARACTER SET 'latin1';
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]> CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
ERROR 1046 (3D000): No database selected
MariaDB [(none)]>
MariaDB [(none)]>
...From the same page,
I added this from the top:
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=root
gmysql-dbname=pdns
gmysql-password=mysecretpassword
and then 'service start pdns'
I see this error message in each spawn...
Unable to load module '/usr/lib/x86_64-linux-gnu/pdns/libgmysqlbackend.so': /usr/lib/x86_64-linux-gnu/pdns/libgmysqlbackend.so: cannot open shared object file: No such file or directory
I figure there's a configuration gap here, but can't find it.
More information about the Pdns-users
mailing list