How to reference primary key when inserting in MySQL
You need to declare the column itself, so the books table should look like:

CREATE TABLE if not exists books
( book_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT
, title VARCHAR(255) NOT NULL
, genre VARCHAR(30) NOT NULL
, author_id INT UNSIGNED NOT NULL

,    FOREIGN KEY(author_id) REFERENCES authors(author_id)
);


I added NOT NULL on columns title and genre since I believe they are mandatory in most situations.

I would say that you also need something that uniquely identifies an author in real life, let's assume name does:

CREATE TABLE if not exists authors
( author_id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
, name VARCHAR(30) NOT NULL UNIQUE
);


Now you can insert a new book like:

INSERT INTO books (title, genre, author_id)
SELECT 'The Shining', 'Horror', author_id
FROM authors
WHERE name = 'Stephen King';