Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql grant user permissions

-- create user if not exists
-- CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';");

-- grant all user permissions on all database and tables
-- GRANT ALL ON *.* TO 'username'@'localhost'");

-- create specific database
-- CREATE DATABASE newdatabase

-- grant all user permissions on db 'newdatabase' and all tables
-- GRANT ALL ON newdatabase.* TO 'username'@'localhost'");

-- grant all user permissions on db 'newdatabase' and table 'newtable'
-- GRANT ALL ON newdatabase.newtable TO 'username'@'localhost'");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #mysql #grant #user #permissions
ADD COMMENT
Topic
Name
9+6 =