Skip to content

Commit

Permalink
Change the playground info for connecting to TiDB (pingcap#1133)
Browse files Browse the repository at this point in the history
A `tiup playground nightly` results in:
```
To connect TiDB: mysql --host 127.0.0.1 --port 4000 -u root
```

Running this doesn't work:
```
$ mysql --host 127.0.0.1 --port 4000 -u root
ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
```

This happens if a `~/.mylogin.cnf` is present or if a password is configured in `~/.my.cnf`.

```
$ mysql_config_editor print
[client]
password = *****

```

Adding a `-p` to `mysql` will cause this to prompt for passwords, just pressing
enter then results in a working connection.

Another option would be to set a password for the root user and use `-p<passwd>`
on the command.
  • Loading branch information
dveeden authored and lucklove committed Mar 3, 2021
1 parent 28f4cf7 commit 5c00956
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/playground/playground.go
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ func (p *Playground) bootCluster(ctx context.Context, env *environment.Environme
fmt.Println(color.GreenString("CLUSTER START SUCCESSFULLY, Enjoy it ^-^"))
for _, dbAddr := range succ {
ss := strings.Split(dbAddr, ":")
fmt.Println(color.GreenString("To connect TiDB: mysql --host %s --port %s -u root", ss[0], ss[1]))
fmt.Println(color.GreenString("To connect TiDB: mysql --host %s --port %s -u root -p (no password)", ss[0], ss[1]))
}
}

Expand Down

0 comments on commit 5c00956

Please sign in to comment.