User Tools

This is an old revision of the document!


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

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information