Ubuntu 管理心得

搜尋此網誌

2020年2月27日 星期四

setup permission for mysqldump


  1. Create ~/.my.cnf, add these lines:
    [mysqldump]
    user=student
    password=student
    chmod 0600 ~/.my.cnf
  2. Inside phpmyadmin, set 'Select' and 'LOCK TABLES' permission to database 'drupal' for 'student' as the following image:


  3. Then, dump drupal with the command without username and password:
     mysqldump drupal > kpchiao9600k_drupal.sql
    or
     mysqldump -B drupal > kpchiao9600k_drupal.sql
    The -B option will add the create database and use datatebase lines into dump file as:
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ `drupal` /*!40100 DEFAULT CHARACTER SET latin1 */;

    USE `drupal`;





沒有留言:

張貼留言

網誌存檔