Login | Register RSS

Linux MySQL Tips

Recursively chmod directories only

# find /some/folder -type d -exec chmod 755 {} \;

This will recursively search your directory tree (starting at dir ‘folder’) and chmod 755 all directories only.

Similarly, the following will chmod all files only (and ignore the directories):

# find . -type f -exec chmod 644 {} \;


MySQL Tips:

Use this command to create a new username, with a password, but no grant permissions.

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

Use this command to remove a username.

DROP USER 'username'@'localhost';

Use this command to grant permission to a specific user to read, add, edit & remove data from all tables of a given database. You can use '*.*', instead of 'database.*', if you want to revoke from all databases at one time. 

GRANT SELECT, INSERT, UPDATE, DELETE ON database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

Use this command to revoke the grant permission of a specific user to read, add, edit & remove data from all tables of a given database. You can use '*.*', instead of 'database.*', if you want to revoke from all databases at one time.

REVOKE SELECT, INSERT, UPDATE, DELETE ON database.* TO 'username'@'localhost';
FLUSH PRIVILEGES;

If you like this site or any of its content, please help promote it. Use the social media buttons below to help spread the word. Don't forget to post in the comments section.

  Print   Email
Latest Blog Posts:
Latest Q&A Posts:

© 2020 BuildDesignCreate.com • All Rights Reserved
Privacy PolicyAdvertise with UsContact UsSite Map