Report this

What is the reason for this report?

How can I create a new user in mysql on my LAMP droplet (Ubuntu 20.04)

Posted on February 7, 2022

I followed this tutorial (step 6) to set up a new mysql user as I am trying to access the database (already created through phpmyadmin) with PHP. https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04

When I login to the console and try to create the new user with a string like this: CREATE USER ‘example_user’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘password’;

I get an error saying RROR 1064 (42000): 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 ‘BY ‘password’’ at line 1

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.