Report this

What is the reason for this report?

sudo mysql-create-db-and-user - SQL syntax ERROR 1064 (42000) at line 1

Posted on May 31, 2022

Can anyone help get this command working again? This cmd used to work in the putty console -

sudo mysql-create-db-and-user dbuserhere dbnamehere passwordhere

This error now appears -

ERROR 1064 (42000) at line 1: 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 'IDENTIFIED BY 'passwordhere'' at line 1

I have MySQL version 8.0.28 on Ubuntu 20.04.4 LTS.

The database is created but I can’t connect to it using the username and password used in the cmd.

I can only guess it stopped working after I did sudo apt update and sudo apt upgrade.

This is the error in /var/log/mysql/error.log

2022-05-26T04:50:06.754109Z 21 [Warning] [MY-013360] [Server] Plugin sha256_password reported: ''sha256_password' is deprecated and will be removed in a future release. Please use caching_sha2_password instead'

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.