How to Create a MySQL User and Grant Privileges

Create user fs_cloud with password TMW7YxxjnaPc6kxX:

CREATE USER 'fs_cloud'@'%' IDENTIFIED BY 'TMW7YxxjnaPc6kxX';

Create database fs_cloud:

create database fs_cloud default charset utf8 collate utf8_general_ci;

Grant access to the fs_cloud database for user fs_cloud (% enables remote access, allowing connections from all hosts):

grant all privileges on fs_cloud.* to 'fs_cloud'@'%' with grant option;

Flush the system privileges table:

flush privileges;

Note: Due to differences in major MySQL versions, the command syntax may vary slightly.

Leave a Comment

Your email address will not be published.