What is the best way to grant user on sql
04:28 15 Oct 2024

I am trying to learn the best methods to grant user privileges on database

CREATE USER IF NOT EXIST `'silas'@localhost'` IDENTIFIED BY '1234' 
GRANT ALL PRIVILEGES ON *.* TO 'silas'@'localhost';

or

GRANT ALL PRIVILEGES ON `my_db.*` TO `'silas'@'localhost'`;

I am just trying to find the best way to do this.

advice sql mysql