Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #4

Merged
merged 1 commit into from
Jun 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func main() {
config.Addr = "your-hostname:your-port"

dumpDir := "dumps" // you should create this directory
dumpFilenameFormat := fmt.Sprintf("%s-20060102T150405", dbname) // accepts time layout string and add .sql at the end of file
dumpFilenameFormat := fmt.Sprintf("%s-20060102T150405", config.DBName) // accepts time layout string and add .sql at the end of file

db, err := sql.Open("mysql", config.FormatDNS())
db, err := sql.Open("mysql", config.FormatDSN())
if err != nil {
fmt.Println("Error opening database: ", err)
return
Expand All @@ -39,12 +39,12 @@ func main() {
}

// Dump database to file
resultFilename, err := dumper.Dump()
err := dumper.Dump()
if err != nil {
fmt.Println("Error dumping:", err)
return
}
fmt.Printf("File is saved to %s", resultFilename)
fmt.Printf("File is saved to %s", dumpFilenameFormat)

// Close dumper, connected database and file stream.
dumper.Close()
Expand Down