Help Needed to Set Up Mail Server

I've been frustratingly following this guide: https://library.linode.com/email/postfi … 0.19-mysql">https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql

However, I'm stuck on the section Adding Data, 1.

> Adding Data

Now that you've created the database and tables, let's add some data to MySQL. Here's how:

Add your domains to the virtual_domains table. You can add as many domains as you want in the VALUES section of the command below, but in this example you'll add just the primary domain (example.com), your hostname (hostname), your FQDN (hostname.example.com), and localhost.example.com. (You'll add localhost in a different file later). Be sure to replace example.com and hostname with your own domain name and hostname. You'll need an id value and a name value for each entry. Separate each entry with a comma (,), and close the last one with a semicolon (;).

INSERT INTO `mailserver`.`virtual_domains`
  (`id` ,`name`)
VALUES
  ('1', 'example.com'),
  ('2', 'hostname.example.com'),
  ('3', 'hostname'),
  ('4', 'localhost.example.com');

Note

Make a note of which id goes with which domain - you'll need for the next two steps.

I typed the the code listed there and replaced the example.com with my own domain and such, but when I hit enter in PuTTy, I get this error:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''mailserverdb'.'virtual_domains'   ('id', 'name') VALUES   ('1', 'facetedgames.c' at line 1

I've checked and double checked and I have copied the code verbatim with the proper placeholders replaced with the correct values, but I keep getting that error. It is extremely frustrating and I'm close to ripping out my hair. What is wrong?

3 Replies

According to the error message you are using single quotes (') where you should be using backticks (`). They are different.

Oh. They're backticks. I don't know how I completely missed that! Thank you Nibbler!

Hmm, I have a question:

It says I should use my FQDN for "hostname.example.com". Should I still use my FQDN when I add other domains when those domains aren't the same as my FQDN?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct