Database Content Loss

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

Original topic: 数据库内容丢失

| username: TiDBer_kMTvTIEv

[TiDB Usage Environment] Production Environment / Testing / PoC
System: Ubuntu 18.04
[TiDB Version]
7.5.0
[Reproduction Path] Operations performed that led to the issue
I followed the single-node deployment method from the official website and executed the startup command tiup playground.
[Encountered Issue: Problem Description and Impact]
However, when I stop it by pressing Ctrl+C and then re-execute tiup playground, all the content in MySQL is cleared.
[Attachments: Screenshots/Logs/Monitoring]

| username: 江湖故人 | Original post link

Local Quick Deployment of TiDB Cluster | PingCAP Documentation Center

Specify tag when starting the cluster

When the Playground cluster exits from the command line, it will by default clear all cluster data. If you want to start a Playground cluster where the data is not automatically deleted, you need to specify a cluster tag at startup. After specifying, you can find the data of the cluster in the ~/.tiup/data path. The method to specify a tag when starting the cluster is as follows:

tiup playground --tag <tagname>
| username: TiDBer_kMTvTIEv | Original post link

Does this tagname need to be created manually?

| username: 江湖故人 | Original post link

Yes, for example:
tiup playground --db 2 --pd 3 --kv 3 --host 0.0.0.0 --tag test2023

| username: 啦啦啦啦啦 | Original post link

By default, exiting will clear the data. If you want to retain the data, you can follow the method mentioned above. However, it is still recommended to use tiup cluster deploy to deploy a real cluster. tiup playground is generally used for temporary deployments.

| username: wangccsy | Original post link

Isn’t it TiDB? MySQL is a system SCHEMA, and it is generally not recommended to operate directly within it.

| username: TiDBer_小阿飞 | Original post link

When exiting the Playground cluster from the command line, all cluster data will be cleared by default.

| username: zhanggame1 | Original post link

You can test by installing a single-machine simulated cluster, no need for playground.

| username: TIDB-Learner | Original post link

TiDB Playground is generally suitable for beginners in databases. If you don’t want the data to be deleted after exiting, add the parameter --tag. It is recommended to set up a single-node hybrid deployment.

| username: dba远航 | Original post link

tiup playground is a process-based demonstration database. Once it is terminated, it will be gone. If you want to save it, you need to add --tag.

| username: Kongdom | Original post link

Has this issue been resolved?
If it has been resolved, please mark the question as [Marked as Best Answer] so that it can be searchable and help others find the answer more efficiently.
If your issue has not been resolved, please continue to ask and provide feedback on the problems you encountered, including operation prompts or screenshots.

| username: kkpeter | Original post link

Deploy a formal one and take a look.

| username: TiDBer_5Vo9nD1u | Original post link

By default, it is cleaned up.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.