MySQL Cheat Sheet

From Michael's Information Zone
Revision as of 16:45, 1 December 2016 by Michael.mast (talk | contribs) (Created page with "<ref>http://alvinalexander.com/blog/post/mysql/show-users-i-ve-created-in-mysql-database</ref>*View users select host, user, password from mysql.user; <ref>http://stackoverfl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[1]*View users

select host, user, password from mysql.user;

[2]*Remove history (this is kept in your home directory)

rm -rf ~/.mysql_history
  • Remove user
drop user <username>@<host>;
  • Remove database
drop database <databasename>;
  • Grant privileges
grant all on <database>.<table> to <user>@<host> identified by '<password>';
grant all on test.* to 'michael'@'172.17.0.34' identified by 'mypassword';