Error reported when starting tiup playground

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tiup playground启动报error

| username: zhangbaqing

[Test Environment for TiDB]
[TiDB Version] v6.3.0
[Reproduction Steps]

  1. Start the cluster
    tiup playground -T zbq v6.3.0
  2. Log in to the client and change the root user password
    mysql --comments --host 127.0.0.1 --port 4000 -u root -p
    alter user ‘root’ identified by ‘xxx’;
    flush privileges;
    quit;
  3. Stop the cluster and restart
    tiup playground -T zbq v6.3.0
    TiDB reports an error on startup
    [Encountered Issue: Phenomenon and Impact]
  4. Phenomenon: TiDB startup failed;
  5. Impact: How to determine if TiDB has started normally?
    [Resource Configuration]
  6. Resource Configuration: Local startup
    [Attachments: Screenshots/Logs/Monitoring]
  7. Screenshot:
| username: WalterWj | Original post link

Is the port occupied? Check the hidden directory under the home directory .tiup and look at the logs.

| username: Kongdom | Original post link

How was the cluster stopped?

| username: zhangbaqing | Original post link

Ctrl + C

| username: Kongdom | Original post link

Execute this to see if there are any clusters already started:

tiup playground display
| username: zhangbaqing | Original post link

  1. The port should not be occupied;
  2. Checked the logs, the program attempted to connect to the database without a password, causing an error
    cd ~/.tiup/data/zbq/tidb-0
    grep -rni ‘error’ .
| username: WalterWj | Original post link

The playground is just for debugging, it’s not enough. Install one with Docker, hehe.

| username: WalterWj | Original post link

After pressing ctrl c, is the 4000 port still there? Because when you started, 4000 was an error, which feels a bit strange.

| username: zhangbaqing | Original post link

After pressing Ctrl + C, port 4000 is no longer available.

| username: WalterWj | Original post link

Is there still an error when starting now? :thinking:

| username: zhangbaqing | Original post link

It seems that the error has been identified. After changing the root user’s password and then attempting to log in without a password, an error occurs.

At this point, TiDB has actually already started.

| username: zhangbaqing | Original post link

The image link you provided appears to be broken or inaccessible. Please provide the text you need translated.

| username: WalterWj | Original post link

Alright, I’ve learned something new. If it doesn’t work: TiDB 用户账户管理 | PingCAP 文档中心

| username: Kongdom | Original post link

Uh… this error~

| username: 我是咖啡哥 | Original post link

I always thought that tiup playground couldn’t persist data, but it turns out you can do it by adding -T. I specifically checked the documentation, and I’m not sure if I didn’t read it carefully before or if it was added later.

Note

  • TiDB versions v5.2.0 and above support running tiup playground on machines with Apple M1 chips.
  • The playground executed in this way will have its original cluster data cleaned up by TiUP after the deployment test ends. Re-executing the command will result in a brand new cluster.
  • If you want to persist data, you can use TiUP’s --tag parameter: tiup --tag <your-tag> playground .... For details, refer to the TiUP Reference Manual.