SELECT table_schema AS DB, SUM(index_length + data_length)/(1024 * 1024) AS "Size (MB)" FROM information_schema.tables GROUP BY table_schema;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO 'userid'@'host' IDENTIFIED BY 'password';
mysql -B -e 'SELECT DISTINCT CONCAT('\''show grants for `'\'', user, '\''`@`'\'', host, '\''`;'\'') AS query FROM mysql.user;' | grep -v query | mysql
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.