Mysql create new user

To create a new user in MySQL, you can use the following command:

CREATE USER 'username'@'host' IDENTIFIED BY 'password';

Here:

For example, to create a new user named john who can connect from any host with the password mypassword, you would use the following command:

CREATE USER 'john'@'%' IDENTIFIED BY 'mypassword';

You can also specify additional options when creating a new user, such as:

You can also use the CREATE USER statement with the INFILE clause to create a new user from a file, for example:

CREATE USER 'john'@'%' IDENTIFIED BY 'mypassword' INFILE '/path/to/file.txt';

This creates a new user john with the password mypassword and grants the privileges specified in the file /path/to/file.txt.

Note that you need to have the CREATE USER privilege to create a new user in MySQL.