MySQL SQL> ERROR: Not connected. Problem with creating a MySQL user

1.1k Views Asked by At

I asked this question here an hour ago. I got a message that my question is closed, because it already has an answer here: Create new user in MySQL and give it full access to one database. However, I think this is a mistake because I didn't find anything relevant there! So I'm trying to ask again (hopefully that's okay):

I'm trying to create a database using MySQL.

I understand that I need to create a user to do so, and then I can create a database and use it in my python project. is that correct?

this is what I tried to run in the MySQL Shell:

MySQL  JS > \sql
MySQL  SQL > CREATE USER 'myname'@'localhost' IDENTIFIED BY 'mypassword';

I wanted to continue with:

 MySQL  SQL > GRANT ALL PRIVILEGES ON * . * TO 'myname'@'localhost';

but I got this error- ERROR: Not connected

I looked up ways to fix it, but the only way I found was for people who already have a user.

Does anyone know how to fix this? Thank you.

0

There are 0 best solutions below