diff --git a/develop/dev-guide-sample-application-ruby-mysql2.md b/develop/dev-guide-sample-application-ruby-mysql2.md index fae95d233cec0..92529bf2bc0f5 100644 --- a/develop/dev-guide-sample-application-ruby-mysql2.md +++ b/develop/dev-guide-sample-application-ruby-mysql2.md @@ -99,15 +99,15 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele cp .env.example .env ``` -6. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `<>` with connection parameters in the connection dialog: +6. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: ```dotenv - DATABASE_HOST= - DATABASE_PORT=4000 - DATABASE_USER= - DATABASE_PASSWORD= - DATABASE_NAME=test - DATABASE_ENABLE_SSL=true + DATABASE_HOST={host} + DATABASE_PORT=4000 + DATABASE_USER={user} + DATABASE_PASSWORD={password} + DATABASE_NAME=test + DATABASE_ENABLE_SSL=true ``` > **Note** @@ -133,16 +133,16 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele cp .env.example .env ``` -5. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `<>` with connection parameters in the connection dialog: +5. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with connection parameters in the connection dialog: ```dotenv - DATABASE_HOST= + DATABASE_HOST={host} DATABASE_PORT=4000 - DATABASE_USER= - DATABASE_PASSWORD= + DATABASE_USER={user} + DATABASE_PASSWORD={password} DATABASE_NAME=test DATABASE_ENABLE_SSL=true - DATABASE_SSL_CA= + DATABASE_SSL_CA={downloaded_ssl_ca_path} ``` > **Note** @@ -162,13 +162,13 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele cp .env.example .env ``` -2. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `<>` with your own TiDB connection information: +2. Edit the `.env` file, set up the environment variables as follows, and replace the corresponding placeholders `{}` with your own TiDB connection information: ```dotenv - DATABASE_HOST= + DATABASE_HOST={host} DATABASE_PORT=4000 - DATABASE_USER= - DATABASE_PASSWORD= + DATABASE_USER={user} + DATABASE_PASSWORD={password} DATABASE_NAME=test ``` diff --git a/develop/dev-guide-sample-application-ruby-rails.md b/develop/dev-guide-sample-application-ruby-rails.md index 8bc76439a1830..83732dbaa02e2 100644 --- a/develop/dev-guide-sample-application-ruby-rails.md +++ b/develop/dev-guide-sample-application-ruby-rails.md @@ -97,7 +97,7 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele 6. Edit the `.env` file, set up the `DATABASE_URL` environment variable as follows, and copy the connection string from the connection dialog as the variable value. ```dotenv - DATABASE_URL=mysql2://:@:/?ssl_mode=verify_identity + DATABASE_URL=mysql2://{user}:{password}@{host}:{port}/{database_name}?ssl_mode=verify_identity ``` > **Note** @@ -126,7 +126,7 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele 5. Edit the `.env` file, set up the `DATABASE_URL` environment variable as follows, copy the connection string from the connection dialog as the variable value, and set the `sslca` query parameter to the file path of the CA certificate downloaded from the connection dialog: ```dotenv - DATABASE_URL=mysql2://:@:/?ssl_mode=verify_identity&sslca=/path/to/ca.pem + DATABASE_URL=mysql2://{user}:{password}@{host}:{port}/{database}?ssl_mode=verify_identity&sslca=/path/to/ca.pem ``` > **Note** @@ -146,10 +146,10 @@ Connect to your TiDB cluster depending on the TiDB deployment option you've sele cp .env.example .env ``` -2. Edit the `.env` file, set up the `DATABASE_URL` environment variable as follows, and replace the ``, ``, ``, ``, and `` with your own TiDB connection information: +2. Edit the `.env` file, set up the `DATABASE_URL` environment variable as follows, and replace the `{user}`, `{password}`, `{host}`, `{port}`, and `{database}` with your own TiDB connection information: ```dotenv - DATABASE_URL=mysql2://:@:/ + DATABASE_URL=mysql2://{user}:{password}@{host}:{port}/{database} ``` If you are running TiDB locally, the default host address is `127.0.0.1`, and the password is empty.