User Tools

Site Tools


mysql

mysql

Add a user

source

CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;

Grant multiple permissions

GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’;

Revoke permissions

REVOKE [type of permission] ON [database name].[table name] FROM ‘[username]’@‘localhost’

Delete user

DROP USER ‘demo’@‘localhost’;

table size

SELECT table_schema,round(sum(data_length+index_length)/1024/1024,4) FROM information_schema.tables WHERE table_schema = 'beta_grid' AND table_name = 'assets';

user config file

in ~/.my.cnf

[client]
host     = localhost
user     = myusername
password = mypassword
socket   = /var/run/mysqld/mysqld.sock
 
[mysqld]
# Performance settings used for import.
delay_key_write=ALL
bulk_insert_buffer_size=256M

mysql.txt · Last modified: by 127.0.0.1