mysql常用命令

  • 創建用戶
CREATE USER '用戶名'@'localhost' IDENTIFIED BY '密碼';
  • 給用戶賦予權限
所有權限:grant all privileges on databasename.tablename  to '用戶名'@'localhost';
增刪查改:grant select,delete,update,create,drop  on databasename.tablename  to '用戶名'@'localhost';
如果要操作所有的數據庫databasename用*,如果要操作所有的表tablename用*
對用戶賦予所有庫所有表所有權限:grant all privileges on *.*to '用戶名'@'localhost';
最後需要刷新權限表:flush privileges; 
  • 查看錶結構
desc tablename;
  • 查看bin-log是否開啓
show variables like '%log_bin%';
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章