'#1064 Error - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax

I'm new to PHP and MySQL and ran into a problem while doing a project to learn

every time I try to create a table

CREATE DATABASE student character set utf8mb4;

USE student

   
CREATE TABLE details
(
  id int(11) AUTO_INCREMENT,
  name varchar(50) NOT NULL,
  email varchar(50) NOT NULL,
  password varchar(50) NOT NULL,
  gender enum('m','f') NOT NULL,
  PRIMARY KEY (id),
  UNIQUE KEY email (email)
) engine= InnoDB;

CREATE USER 'test'@'localhost' IDENTIFIED BY 'test';
GRANT ALL PRIVILEGES ON student.* TO 'test'@'localhost';

I get the following error message

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE details ( id int(11) AUTO_INCREMENT, name varchar(50) NOT...' at line 4

I'm currently working with

Server type: MariaDB

Server version: 10.4.22-MariaDB

phpMyAdmin: 5.1.1

I've spent a while trying to figure this out so figured I'd ask for some help to see if someone can tell me where I'm going wrong



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source