Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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

list mysql users

// login to mysql as root
mysql -u root -p
// use mysql database
use mysql;
// list users
select user,host from user;
Comment

mysql list users

# List All Unique Usernames
SELECT DISTINCT User FROM mysql.user;
# List All Usernames + Hostnames;
SELECT User,Host FROM mysql.user;
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 :: get schema of table sql 
Sql :: oracle list packages 
Sql :: postgres change the name of schema 
Sql :: oracle rename table 
Sql :: drop table if exists in postgres 
Sql :: sql server list table sizes 
Sql :: oracle search text in all packages 
Sql :: rename table sql 
Sql :: change column names mssql 
Sql :: mysql select last 15 minutes 
Sql :: sql server get timezone 
Sql :: no data found oracle 
Sql :: how to get list of synonyms in oracle 
Sql :: oracle create_program 
Sql :: top 10 rows in mysql 
Sql :: CREATE DATABASE db; SyntaxError: Unexpected identifier 
Sql :: athena query timestamp greater than 
Sql :: how to get current date in mysql 
Sql :: sql server find all foreign keys that reference a column 
Sql :: mysql drop primary key 
Sql :: mysql password error create datbase 
Sql :: sql getdate minus 1 day without time 
Sql :: mysql date between two dates 
Sql :: postgres update column with value from another table 
Sql :: pl sql dynamic sql drop doesnt work 
Sql :: mysql reset auto increment 
Sql :: oracle nls instance 
Sql :: delete top 100 rows in sql server 
Sql :: substr sql last character 
Sql :: create database store 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =