Create.vmail.sql: Difference between revisions
Jump to navigation
Jump to search
(DB creation script) |
m (limited vmal_admin rights) |
||
Line 1: | Line 1: | ||
USE mysql; | USE mysql; | ||
REPLACE INTO user (host, user, password) | REPLACE INTO user (host, user, password) | ||
VALUES ( | |||
'localhost', | |||
'vmail_admin', | |||
PASSWORD('SuperSecret') | |||
); | ); | ||
REPLACE INTO db (host, db, user, select_priv | REPLACE INTO db (host, db, user, select_priv) | ||
VALUES ( | |||
'localhost', | |||
'vmail', | |||
'vmail_admin', | |||
'Y' | |||
); | |||
); | -- Make sure that priviliges are reloaded. | ||
FLUSH PRIVILEGES; | |||
-- Make sure that priviliges are reloaded. | |||
FLUSH PRIVILEGES; | -- we're assuming the database does not exist yet | ||
CREATE DATABASE vmail; | |||
-- we're assuming the database does not exist yet | |||
CREATE DATABASE vmail; | USE vmail; | ||
USE vmail; | CREATE TABLE domains ( | ||
domain VARCHAR(50) NOT NULL, | |||
CREATE TABLE domains ( | |||
PRIMARY KEY (domain) ) TYPE=MyISAM; | |||
CREATE TABLE forwardings ( | |||
source VARCHAR(80) NOT NULL, | |||
CREATE TABLE forwardings ( | destination TEXT NOT NULL, | ||
PRIMARY KEY (source) ) TYPE=MyISAM; | |||
CREATE TABLE users ( | |||
emailaddr VARCHAR(80) NOT NULL, | |||
CREATE TABLE users ( | passwd VARCHAR(30) NOT NULL, | ||
PRIMARY KEY (emailaddr) ) TYPE=MyISAM; | |||
CREATE TABLE relaydomains ( | |||
rdomain VARCHAR(80) NOT NULL, | |||
CREATE TABLE relaydomains ( | transport VARCHAR(80) NOT NULL, | ||
PRIMARY KEY (rdomain) ) TYPE=MyISAM; | |||
FLUSH PRIVILEGES; | |||
FLUSH PRIVILEGES; |
Revision as of 22:04, 30 October 2008
USE mysql; REPLACE INTO user (host, user, password) VALUES ( 'localhost', 'vmail_admin', PASSWORD('SuperSecret') ); REPLACE INTO db (host, db, user, select_priv) VALUES ( 'localhost', 'vmail', 'vmail_admin', 'Y' ); -- Make sure that priviliges are reloaded. FLUSH PRIVILEGES; -- we're assuming the database does not exist yet CREATE DATABASE vmail; USE vmail; CREATE TABLE domains ( domain VARCHAR(50) NOT NULL, PRIMARY KEY (domain) ) TYPE=MyISAM; CREATE TABLE forwardings ( source VARCHAR(80) NOT NULL, destination TEXT NOT NULL, PRIMARY KEY (source) ) TYPE=MyISAM; CREATE TABLE users ( emailaddr VARCHAR(80) NOT NULL, passwd VARCHAR(30) NOT NULL, PRIMARY KEY (emailaddr) ) TYPE=MyISAM; CREATE TABLE relaydomains ( rdomain VARCHAR(80) NOT NULL, transport VARCHAR(80) NOT NULL, PRIMARY KEY (rdomain) ) TYPE=MyISAM; FLUSH PRIVILEGES;