Now Hiring: Are you a driven and motivated 1st Line IT Support Engineer?

Blog

Một số lệnh hay dùng khi sử dụng MySQL

Công nghệ

Một số lệnh hay dùng khi sử dụng MySQL

Gán quyền cho user, host vào

grant all privileges on database.table_name to username@'host' identified by 'password';

List user, host

SELECT User, Host, Password FROM mysql.user;

Xóa bớt user

DROP USER 'user'@'host';

Limit

CREATE USER 'francis'@'localhost' IDENTIFIED BY 'frank';

GRANT ALL ON customer.* TO 'francis'@'localhost'
    ->     WITH MAX_QUERIES_PER_HOUR 20
    ->          MAX_UPDATES_PER_HOUR 10
    ->          MAX_CONNECTIONS_PER_HOUR 5
    ->          MAX_USER_CONNECTIONS 2;

 

 

Dump mysql database

mysqldump -uroot -p database > ~/bak/database.sql

Restore mysql database

mysql -uroot -p database < ~/bak/database.sql

 

Leave your thought here

Your email address will not be published. Required fields are marked *

Select the fields to be shown. Others will be hidden. Drag and drop to rearrange the order.
  • Image
  • SKU
  • Rating
  • Price
  • Stock
  • Availability
  • Add to cart
  • Description
  • Content
  • Weight
  • Dimensions
  • Additional information
Click outside to hide the comparison bar
Compare