Search
 
SCRIPT & CODE EXAMPLE
 

SQL

grant revoke privileges to mysql username

#in SQL execute
#GRANT type_of_permission ON database_name.table_name TO 'username'@'localhost';
GRANT ALL PRIVILEGES ON * . * TO 'username'@'localhost';
#reload all the privileges
FLUSH PRIVILEGES;

#Show Privileges
SHOW GRANTS FOR 'username'@'localhost';

#Revoke Privileges
REVOKE type_of_permission ON database_name.table_name FROM 'username'@'localhost';
Comment

mysql grant all privileges to a user

GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
Comment

mysql users and privileges list

SELECT * FROM mysql.user;

SELECT * FROM information_schema.user_privileges;
SELECT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') FROM mysql.user;
SHOW GRANTS FOR 'my_user'@'localhost';
Comment

grant all priviledges to mysql user

/*
The GRANT statement is used to assign full control over specific database by providing all priviledge.
Follow below statement for assign priviledge to user
*/

Syntax: 
GRANT ALL PRIVILEGES ON mydb.* TO 'myuser'@'%' WITH GRANT OPTION;

/*
I hope it will help you.
Namaste
*/
Comment

grant all privileges mysql

/*
The GRANT statement is used to assign full control over specific database by providing all priviledge.
Follow below statement for assign priviledge to user
*/

Syntax: 
GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';
Comment

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'");
Comment

how to check user grant in mysql

-- to grant all privileges on 1 database and all its table
GRANT ALL PRIVILEGES ON database_name.* TO 'user'@'localhost';
-- to grant all privileges on all databases and all their respective tables
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost';
Comment

PREVIOUS NEXT
Code Example
Sql :: how to restart mysql in linux 
Sql :: show databases in sql server 
Sql :: postgresql calculate age from birthdate 
Sql :: Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. Input Format The STATION table is described as follows: 
Sql :: query to list all tables in sql database 
Sql :: mysql database stopped xampp mac 
Sql :: mysql date minus 1 day 
Sql :: while loop sql 
Sql :: postgresql change column type 
Sql :: sql delete multiple ids 
Sql :: how to stop all connections to a psql 12 database? 
Sql :: Mysql query add column with default string value 
Sql :: mysql interval 1 day 
Sql :: how to unlock table in mysql 
Sql :: delete first row in sql 
Sql :: The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue. 
Sql :: alter default column value oracle 
Sql :: mysql remove unique constraint 
Sql :: postgresql reset auto increment 
Sql :: MySQL - Enabling the Event Scheduler 
Sql :: group_concat max length mysql 
Sql :: python mysql select 
Sql :: how to add unique constraint in mysql table 
Sql :: node and mysql like 
Sql :: Postgres upgrade to superuser 
Sql :: create a table with an id in mysql 
Sql :: postgres get timestamp 
Sql :: sql change password wordpress 
Sql :: create table sql server auto increment primary key 
Sql :: mysql find non alphanumeric characters 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =