diff --git a/README.md b/README.md index 71d005e04..0b1780d5e 100644 --- a/README.md +++ b/README.md @@ -16,19 +16,19 @@ We are hiring. Please check out our [about page](https://www.bytebase.com/about) 1. Clone this repository -```text +```bash git clone git@github.com:bytebase/bytebase.com.git ``` 1. Install dependencies -```text +```bash pnpm install ``` 1. Run website locally -```text +```bash pnpm run dev ``` @@ -93,13 +93,13 @@ Use animated recording judicious. Sometimes you have to use animation to showcas Additional commands: -```text +```bash pnpm run lint ``` Run it to check the current status of eslint issues across project. -```text +```bash pnpm run lint:fix ``` @@ -111,7 +111,7 @@ Run it to fix all possible issues. Additional commands: -```text +```bash pnpm run format ``` diff --git a/content/blog/global-variable-support-in-nuxt.md b/content/blog/global-variable-support-in-nuxt.md index ac1b197f6..7564f1cda 100644 --- a/content/blog/global-variable-support-in-nuxt.md +++ b/content/blog/global-variable-support-in-nuxt.md @@ -11,7 +11,7 @@ description: We recently introduced a global version variable in our Nuxt docs t On our doc site, we have a few pages with instructions on installing Bytebase, like this one: [Deploy Bytebase in Docker within 5 seconds](https://docs.bytebase.com/get-started/deploy-with-docker). On these pages, we teach users how to install the latest version of Bytebase by showing command snippets. -```text +```bash docker run --init \ --name bytebase \ --restart always \ @@ -188,7 +188,7 @@ In markdown files, insert the placeholder `$$bb_version$$` into where we are put ````markdown Run the following command to start Bytebase on [http://bytebase.example.com](http://bytebase.example.com/) -```text +```bash docker run --init \ --name bytebase \ --restart always \ diff --git a/content/blog/how-to-cross-compile-with-cgo-use-goreleaser-and-github-action.md b/content/blog/how-to-cross-compile-with-cgo-use-goreleaser-and-github-action.md index 58e1d0b2d..638173aaa 100644 --- a/content/blog/how-to-cross-compile-with-cgo-use-goreleaser-and-github-action.md +++ b/content/blog/how-to-cross-compile-with-cgo-use-goreleaser-and-github-action.md @@ -77,7 +77,7 @@ For the Linux platform - Compiling from x64 to x64 requires a gcc/g++ toolchain, which we usually use. - Compiling from x64 to arm64 requires a well-maintained toolchain, "aarch64-linux-gnu-gcc". You can get it directly from the Ubuntu package manager: -```text +```bash sudo apt-get -y install gcc-aarch64-linux-gnu ``` diff --git a/content/blog/introducing-bb-Bytebase-CLI-to-manage-database-operations.md b/content/blog/introducing-bb-Bytebase-CLI-to-manage-database-operations.md index b06e949ee..630c56ab2 100644 --- a/content/blog/introducing-bb-Bytebase-CLI-to-manage-database-operations.md +++ b/content/blog/introducing-bb-Bytebase-CLI-to-manage-database-operations.md @@ -28,7 +28,7 @@ This blog post gives an overview of how to install Bytebase CLI `bb` and how to Install `bb` into the folder /usr/local/bin on macOS or Linux by entering the command below: -```text +```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bytebase/install/HEAD/install.sh)" ``` @@ -36,7 +36,7 @@ Install `bb` into the folder /usr/local/bin on macOS or Linux by entering the co Enter the following command to verify the installation: -```text +```bash bb --help ``` @@ -52,7 +52,7 @@ Let's take database schema change as an example. First of all, enter the following command to display the database schema: -```text +```bash bb dump --dsn mysql://root:passwd@localhost:3306/bytebase_test_todo --schema-only ``` @@ -62,7 +62,7 @@ You should see there is a table named "author": Then, add a column named "phone_no" into the table "author" with the following `migrate` command: -```text +```bash bb migrate \ --dsn mysql://root:passwd@localhost:3306/bytebase_test_todo \ --command "ALTER TABLE author ADD COLUMN phone_no VARCHAR(15);" @@ -70,7 +70,7 @@ bb migrate \ Finally, verify database schema with the following `dump` command: -```text +```bash bb dump --dsn mysql://root:passwd@localhost:3306/bytebase_test_todo --schema-only ``` diff --git a/content/blog/streamline-database-change-management-for-tidb-cloud-with-bytebase.md b/content/blog/streamline-database-change-management-for-tidb-cloud-with-bytebase.md index dda32cc55..ac7904625 100644 --- a/content/blog/streamline-database-change-management-for-tidb-cloud-with-bytebase.md +++ b/content/blog/streamline-database-change-management-for-tidb-cloud-with-bytebase.md @@ -39,7 +39,7 @@ Terraform is an Infrastructure-as-Code tool that defines and configures infra re For example, the following code creates a TiDB Cloud Serverless resource: -```text +```hcl terraform { required_providers { tidbcloud = { @@ -65,7 +65,7 @@ provider "tidbcloud" { For example, the following code adds the specified TiDB Cloud instance into Bytebase: -```text +```hcl # Configure the Bytebase Provider terraform { required_providers { diff --git a/content/blog/top-postgres-extension.md b/content/blog/top-postgres-extension.md index f5a53d391..096ade3bf 100644 --- a/content/blog/top-postgres-extension.md +++ b/content/blog/top-postgres-extension.md @@ -65,7 +65,7 @@ The statistics gathered by the module are made available via a view named `pg_st Note that the pg_stat_statements extension only tracks queries that have been executed since it was enabled. If you want to track all queries, you should enable the extension at server start-up by adding the following line to your postgresql.conf file: -```text +```ini shared_preload_libraries = 'pg_stat_statements' ``` diff --git a/content/reference/clickhouse/how-to/how-to-configure-clickhouse-ssl-connection.md b/content/reference/clickhouse/how-to/how-to-configure-clickhouse-ssl-connection.md index 37238bece..107ea3eb3 100644 --- a/content/reference/clickhouse/how-to/how-to-configure-clickhouse-ssl-connection.md +++ b/content/reference/clickhouse/how-to/how-to-configure-clickhouse-ssl-connection.md @@ -42,7 +42,7 @@ We will generate the following certificate chain: To generate Root CA certificate and other peer's certificate request, you need to set up a configure file as below: -```text +```bash cat >req.conf <clickhouse-client-ssl.xml < default @@ -256,7 +256,7 @@ EOF Run the following command, and you are expected to get some output like below: -```text +```bash clickhouse-client –-config=clickhouse-client-ssl.xml ``` @@ -266,7 +266,7 @@ clickhouse-client –-config=clickhouse-client-ssl.xml Use MySQL client to connect the ClickHouse server via SSL. Run the following command, and you are expected to get some output like below: -```text +```bash mysql -u default -p -h YOUR_SERVER_IP -P 9004 --ssl-ca=/etc/ssl/ca.pem --ssl-cert=/etc/ssl/client.pem --ssl-key=/etc/ssl/client.key --execute="STATUS" ``` diff --git a/content/reference/clickhouse/how-to/how-to-run-clickhouse-with-docker-and-connect-using-mysql-client.md b/content/reference/clickhouse/how-to/how-to-run-clickhouse-with-docker-and-connect-using-mysql-client.md index 67ca4e4aa..9d3f565b7 100644 --- a/content/reference/clickhouse/how-to/how-to-run-clickhouse-with-docker-and-connect-using-mysql-client.md +++ b/content/reference/clickhouse/how-to/how-to-run-clickhouse-with-docker-and-connect-using-mysql-client.md @@ -14,7 +14,7 @@ Install [docker](https://docs.docker.com/get-docker/) before you continue. Run the following command to start a ClickHouse server in a docker container. -```text +```bash docker run -d --name tutorial-clickhouse-server --ulimit nofile=262144:262144 --volume=$HOME/tutorial_clickhouse_database:/var/lib/clickhouse yandex/clickhouse-server ``` @@ -22,7 +22,7 @@ docker run -d --name tutorial-clickhouse-server --ulimit nofile=262144:262144 -- Run the following command to connect to ClickHouse server with the default user. -```text +```bash docker run -it --rm --link tutorial-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server ``` @@ -34,7 +34,7 @@ By default, the ClickHouse server provides the default user account which is not Run -```text +```bash docker cp :/etc/clickhouse-server/users.xml . ``` @@ -56,7 +56,7 @@ After the change, the file structure should be something like And then run -```text +```bash docker cp users.xml :/etc/clickhouse-server/users.xml ``` @@ -88,7 +88,7 @@ GRANT ALL PRIVILEGES ON db1.* TO user1 Now we can connect to the server with the created user. -```text +```bash docker run -it --rm --link tutorial-clickhouse-server:clickhouse-server yandex/clickhouse-client --host clickhouse-server -u user1 --password pass1 ``` @@ -170,7 +170,7 @@ By default, it should be`9004`. We start a ClickHouse server with the following command, notice that port 9004 is exposed this time. -```text +```bash docker run -d --name tutorial-clickhouse-server -p 9004:9004 --ulimit nofile=262144:262144 --volume=$HOME/tutorial_clickhouse_database:/var/lib/clickhouse yandex/clickhouse-server ``` @@ -178,7 +178,7 @@ docker run -d --name tutorial-clickhouse-server -p 9004:9004 --ulimit nofile=262 Example of connecting using command-line tool `mysql`: -```text +```bash mysql --protocol tcp -u default -P 9004 ``` diff --git a/content/reference/mongodb/how-to/how-to-configure-mongodb-ssl-connection.md b/content/reference/mongodb/how-to/how-to-configure-mongodb-ssl-connection.md index 6906336e2..1b9dfe4e4 100644 --- a/content/reference/mongodb/how-to/how-to-configure-mongodb-ssl-connection.md +++ b/content/reference/mongodb/how-to/how-to-configure-mongodb-ssl-connection.md @@ -26,7 +26,7 @@ Ensure you have [MongoDB](https://docs.mongodb.com/manual/installation/) and [Op Set up the configuration file: -```text +```bash cat >req.conf < SHOW DATABASES; +--------------------+ | Database | @@ -65,7 +65,7 @@ mysql> SHOW DATABASES; +--------------------+ ``` -```text +```sql # Support LIKE mysql> SHOW DATABASES LIKE '%schema'; +--------------------+ @@ -78,7 +78,7 @@ mysql> SHOW DATABASES LIKE '%schema'; ## 4. Switch to another database - USE xxx -```text +```sql mysql> USE mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A @@ -88,7 +88,7 @@ Database changed ## 5. List all tables under a database - SHOW TABLES -```text +```sql # Support LIKE mysql> SHOW TABLES LIKE 'time%'; +---------------------------+ @@ -104,7 +104,7 @@ mysql> SHOW TABLES LIKE 'time%'; ## 6. Describe table schema - DESCRIBE xxx -```text +```sql mysql> DESCRIBE time_zone; +------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | @@ -114,7 +114,7 @@ mysql> DESCRIBE time_zone; +------------------+---------------+------+-----+---------+----------------+ ``` -```text +```sql # DESC also works mysql> DESC time_zone; +------------------+---------------+------+-----+---------+----------------+ @@ -131,7 +131,7 @@ mysql> DESC time_zone; [FOR user_or_role [USING role [, role] ...]]` -```text +```sql # Show grants for the current user mysql> SHOW GRANTS; +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -140,12 +140,12 @@ mysql> SHOW GRANTS; | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO `root`@`%` WITH GRANT OPTION | ``` -```text +```sql # Show grants for a particular user mysql> SHOW GRANTS FOR root@localhost; ``` -```text +```sql # List all users and grants mysql> SELECT User, Host, Grant_priv, Super_priv FROM mysql.user; +------------------+-----------+------------+------------+ @@ -166,7 +166,7 @@ mysql> SELECT User, Host, Grant_priv, Super_priv FROM mysql.user; _Without the FULL keyword, SHOW PROCESSLIST displays only the first 100 characters of each statement in the Info field._ -```text +```sql mysql> SHOW PROCESSLIST; +-------+-----------------+------------------+------+---------+--------+------------------------+-------------------+ | Id | User | Host | db | Command | Time | State | Info | @@ -179,7 +179,7 @@ mysql> SHOW PROCESSLIST; If you want to apply filtering, then query the underlying `INFORMATION_SCHEMA.PROCESSLIST` table. -```text +```sql mysql> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'root'; +-------+------+------------------+------+---------+------+------------+------------------------------------------------------------------+ | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | @@ -195,36 +195,36 @@ mysql> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'root'; `KILL CONNECTION` is the same as KILL with no modifier: It terminates the connection associated with the given processlist_id, after terminating any statement the connection is executing. This can be useful if you want to terminate a long-running or problematic connection that is causing issues for other users or processes. -```text +```sql mysql> KILL 123; ``` `KILL QUERY` terminates the statement the connection is currently executing, but leaves the connection itself intact. This can be useful if you have a specific query that is causing issues or is taking too long to execute, and you want to terminate only that query without affecting other queries or processes running on the same connection. -```text +```sql mysql> KILL QUERY 123; ``` ## 10. Quit - \q, quit, exit, Ctrl+D/Ctrl+Z -```text +```sql mysql> \q Bye ``` -```text +```sql mysql> exit Bye ``` -```text +```sql mysql> quit Bye ``` Alternatively, you can use the shortcut key `Ctrl+D` (or `Ctrl+Z` on Windows). -```text +```sql mysql> ^DBye ``` @@ -234,7 +234,7 @@ mysql> ^DBye Some query results are much more readable when displayed vertically using `\G`. -```text +```sql mysql> SHOW GRANTS\G; *************************** 1. row *************************** Grants for root@%: GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, CREATE ROLE, DROP ROLE ON *.* TO `root`@`%` WITH GRANT OPTION diff --git a/content/reference/postgres/how-to/how-to-install-postgres-on-mac-ubuntu-centos-windows.md b/content/reference/postgres/how-to/how-to-install-postgres-on-mac-ubuntu-centos-windows.md index c089f18b7..0be1e0fe5 100644 --- a/content/reference/postgres/how-to/how-to-install-postgres-on-mac-ubuntu-centos-windows.md +++ b/content/reference/postgres/how-to/how-to-install-postgres-on-mac-ubuntu-centos-windows.md @@ -18,31 +18,31 @@ If you want a GUI tool, The easiest way to install Postgres on a Mac is to use Homebrew. If you don't have Homebrew installed, you can install it by running the following command in your terminal: -```text +```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` Once you have Homebrew installed, you can install Postgres by running the command -```text +```bash brew install postgresql ``` After Postgres is installed, you can start the database server by running this command, which will start the server and make it available to your local machine. -```text +```bash brew services start postgresql ``` With the Postgres server running, you can create a new database by running the following command, make sure to replace "mydatabase" with the name you want to give your database. -```text +```bash createdb mydatabase ``` Run this command to connect to the database you just created. -```text +```bash psql mydatabase ``` @@ -50,43 +50,43 @@ psql mydatabase The following command will install the latest version of Postgres available in the Ubuntu package repository. -```text +```bash sudo apt-get install postgresql ``` After Postgres is installed, you can start the database server by running the following command, which will start the server and make it available to your local machine. -```text +```bash sudo service postgresql start ``` By default, Postgres creates a user account with the same name as your system user, but with no password. To create a user account, you can run the command and follow the prompts to create a new user account. -```text +```bash sudo -u postgres createuser --interactive ``` You can also set a password for the user account to connect to the Postgres console, run -```text +```bash sudo -u postgres psql ``` and then run (replacing "username" and "password" with the username and password you want to use) -```text +```sql ALTER USER username WITH PASSWORD 'password'; ``` With the Postgres server running and a user account created, you can create a new database with the following (replacing "mydatabase" with the name you want to give your database, and "myuser" with the username you created in the last step) -```text +```bash createdb mydatabase -O myuser ``` Now connect to your new database using the psql command (again, replacing "mydatabase" with the name of your database, and "myuser" with the username you created). -```text +```bash psql mydatabase -U myuser ``` @@ -98,51 +98,51 @@ Open a terminal window on your CentOS machine. You can do this by pressing Ctrl+ Update the package list and upgrade any installed packages by running the following commands: -```text +```bash sudo yum update ``` Install Postgres: -```text +```bash sudo yum install postgresql-server postgresql-contrib ``` Initialize the database: -```text +```bash sudo postgresql-setup initdb ``` Start the Postgres Service: -```text +```bash sudo systemctl start postgresql ``` And enable Postgres to start on Boot: -```text +```bash sudo systemctl enable postgresql ``` Create a new user: -```text +```bash sudo -u postgres createuser --interactive ``` Optionally, you can set a password for the new user: -```text +```bash sudo -u postgres psql -postgres=# \password <user_name> +postgres=# \password ``` Create a new database: -```text -sudo -u postgres createdb <database_name> +```bash +sudo -u postgres createdb ``` ## Install on Windows diff --git a/content/reference/postgres/how-to/how-to-install-postgres-using-docker.md b/content/reference/postgres/how-to/how-to-install-postgres-using-docker.md index 7cff05ac9..504a81386 100644 --- a/content/reference/postgres/how-to/how-to-install-postgres-using-docker.md +++ b/content/reference/postgres/how-to/how-to-install-postgres-using-docker.md @@ -16,7 +16,7 @@ If you are using Mac, you can use following tools which include Postgres docker We need to pull the official PostgreSQL image from Docker Hub. Open your terminal or command prompt and run: -```text +```bash docker pull postgres # -- Instead, for a certain version of postgres, e.g. 14.5, run: # docker pull postgres:14.5 @@ -30,7 +30,7 @@ And wait for the latest version of the PostgreSQL image to be downloaded. Now that we've downloaded the image, we can create and run a PostgreSQL container: -```text +```bash docker run -d --name mypostgres -p 5432:5432 -e POSTGRES_PASSWORD=yourpassword postgres ``` @@ -38,7 +38,7 @@ This command runs the container in **detached mode** in the background, assigns Check whether the PostgreSQL container is running with this command: -```text +```bash docker ps ``` @@ -50,7 +50,7 @@ docker ps You can use the psql cammand to connect to your database. -```text +```bash psql -h localhost -U postgres ``` @@ -58,7 +58,7 @@ psql -h localhost -U postgres Or open an interactive terminal inside the container and connect to the PostgreSQL database with the postgres user. -```text +```bash docker exec -it mypostgres psql -h localhost -U postgres ``` diff --git a/content/reference/postgres/how-to/top-psql-commands-with-examples.md b/content/reference/postgres/how-to/top-psql-commands-with-examples.md index d795a4627..b3fec3ecc 100644 --- a/content/reference/postgres/how-to/top-psql-commands-with-examples.md +++ b/content/reference/postgres/how-to/top-psql-commands-with-examples.md @@ -12,31 +12,31 @@ Below list the 10 most commonly used `psql` commands with examples. If you are using the default PostgreSQL username `postgres` and have not set a password, you can connect to the database using the following command. You will be prompted to enter the password for the `postgres` user. -```text +```bash psql ``` If you are using a different username or have set a password for the `postgres` user, you can connect to the database using the following command. You will be prompted to enter the password for the specified user. -```text +```bash psql -U your_username ``` If the PostgreSQL server is running on a different port than the default (5432), you can connect to the database using the following command. You will be prompted to enter the password for the specified user. -```text +```bash psql -p 5433 ``` If the PostgreSQL server is running on a remote host, you can connect to the database using the following command. You will be prompted to enter the password for the specified user. -```text +```bash psql -h remote_host -p 5432 ``` In all of these examples, you can also specify the name of the database you want to connect to using the `-d` option. For example, to connect to the database named `my_database`, you would use the following command: -```text +```bash psql -d my_database ``` @@ -44,7 +44,7 @@ psql -d my_database To run a single command in PostgreSQL using the `psql` command-line interface, you can use the `-c` option followed by the SQL command you want to execute. -```text +```bash psql -d my_database -c "SELECT * FROM my_table;" ``` @@ -52,7 +52,7 @@ psql -d my_database -c "SELECT * FROM my_table;" This command will all of the databases that are currently available on the server. This can be useful for getting an overview of the databases that are available to you. -```text +```bash postgres-# \l Name | Owner | Encoding | Locale Provider | Collate | Ctype | ICU Locale | ICU Rules | Access privileges @@ -69,7 +69,7 @@ postgres-# \l The `\c` command switches to the specified database. This is useful for working with a specific database after you have listed the available databases. -```text +```bash postgres-# \c postgres psql (16.0, server 16.1 (Debian 16.1-1.pgdg120+1)) @@ -80,7 +80,7 @@ You are now connected to database "postgres" as user "postgres". The `\dt` command lists all of the tables that are currently available in the current database. This can be useful for getting an overview of the tables that are available to you in the current database. -```text +```bash postgres-# \dt List of relations @@ -95,7 +95,7 @@ public | orders | table | postgres The `\d` command describes the specified table. This provides information about the table's columns, data types, and constraints. -```text +```bash postgres-# \d my_table Table: my_table @@ -111,7 +111,7 @@ email | VARCHAR(100) | UNIQUE The `\du` command lists all of the users that exist in the current database. -```text +```bash postgres-# \du List of roles @@ -123,7 +123,7 @@ myuser | CREATEDB The `\du username` command is used to list the roles (users) in the current database that have the specified username. -```text +```bash postgres-# \du myuser List of roles @@ -135,7 +135,7 @@ myuser | CREATEDB If the specified username does not match any roles in the current database, the output will be an empty table. -```text +```bash postgres-# \du youruser List of roles @@ -148,7 +148,7 @@ Role name | Attributes To list all active connections, execute the following SQL query. -```text +```sql postgres-# SELECT * FROM pg_stat_activity; pid | datname | username | client_addr | client_port | backend_start | query_start | query | state @@ -161,13 +161,13 @@ pid | datname | username | client_addr | client_port | backend_start | query_sta You can also filter the results to specific connections based on criteria such as username, database name, or state. For example, to list only active connections to the database mydb, use the following query: -```text +```sql postgres-# SELECT * FROM pg_stat_activity WHERE datname = 'mydb' AND state = 'active'; ``` Similarly, to list connections currently executing queries, use the following query: -```text +```sql postgres-# SELECT * FROM pg_stat_activity WHERE state IN ('active', 'idle in transaction'); ``` @@ -175,13 +175,13 @@ postgres-# SELECT * FROM pg_stat_activity WHERE state IN ('active', 'idle in tra Once you have identified the PID of the connection you want to kill, you can use the `pg_terminate_backend()` function to terminate it. For example, the following command will kill the connection with PID 1234: -```text +```sql postgres-# SELECT pg_terminate_backend(1234); ``` Using the kill command is a less common method for killing PostgreSQL connections, as it can be more dangerous and less reliable than using the pg_terminate_backend() function. However, it may be necessary in certain situations, such as when the connection is unresponsive or the pg_terminate_backend() function fails. -```text +```bash kill -9 1234 ``` @@ -189,7 +189,7 @@ kill -9 1234 Using the `\q` command or the keyboard shortcut `Ctrl+D`(or `Ctrl+Z` on windows). This will immediately exit the psql command-line interface. -```text +```bash \q ``` diff --git a/mintlify/change-database/online-schema-migration-for-mysql.mdx b/mintlify/change-database/online-schema-migration-for-mysql.mdx index b1e37c2a9..dc489ed35 100644 --- a/mintlify/change-database/online-schema-migration-for-mysql.mdx +++ b/mintlify/change-database/online-schema-migration-for-mysql.mdx @@ -94,17 +94,17 @@ Replace `taskID`, `databaseID`, `databaseName` and `tableName` accordingly. If Bytebase is running on docker, show gh-ost status with the command below: -```text +```bash docker exec -it bytebase /bin/sh ``` -```text +```bash echo "status" | nc local:/tmp/gh-ost.taskID.databaseID.databaseName.tableName.sock ``` Otherwise, execute the command below: -```text +```bash echo "status" | nc -U /tmp/gh-ost.taskID.databaseID.databaseName.tableName.sock ``` @@ -121,17 +121,17 @@ To kill gh-ost, you issue "panic" to the UNIX socket file on which gh-ost listen If Bytebase is running on docker, execute the command below to kill gh-ost: -```text +```bash docker exec -it bytebase /bin/sh ``` -```text +```bash echo "panic" | nc local:/tmp/gh-ost.taskID.databaseID.databaseName.tableName.sock ``` Otherwise, run the command below: -```text +```bash echo "panic" | nc -U /tmp/gh-ost.taskID.databaseID.databaseName.tableName.sock ``` diff --git a/mintlify/changelog/bytebase-1-0-4.mdx b/mintlify/changelog/bytebase-1-0-4.mdx index fc43ae469..8434d90e2 100644 --- a/mintlify/changelog/bytebase-1-0-4.mdx +++ b/mintlify/changelog/bytebase-1-0-4.mdx @@ -21,7 +21,7 @@ Support data source name (DSN) formats to connect databases in CLI, e.g. `--dsn User can install `bb` CLI with only one command. -```text +```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bytebase/bytebase/HEAD/scripts/install_bb.sh)" ``` diff --git a/mintlify/get-started/instance.mdx b/mintlify/get-started/instance.mdx index adc448e33..a4bda07b6 100644 --- a/mintlify/get-started/instance.mdx +++ b/mintlify/get-started/instance.mdx @@ -161,7 +161,7 @@ If you have a custom external secret manager, you can supply its API endpoint by Usually `mydbkey` is unique for each database and used for exchanging the password for that database. -```text +```bash curl "http://example.com/secrets/mydbkey" ``` @@ -315,11 +315,11 @@ Restart Bytebase with the following environment variables - `AWS_REGION`=`us-east-1` - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are the ones you previously created on the IAM user: -```text +```bash AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy ./bytebase <> ``` -```text +```bash docker run --init \ -e AWS_REGION=us-east-1 AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy \ --name bytebase \ @@ -430,7 +430,7 @@ won't be able to access the key file. -```text +```bash docker run --init \ -e GOOGLE_APPLICATION_CREDENTIALS=/var/opt/bytebase/key.json \ --name bytebase \ diff --git a/mintlify/get-started/self-host/deploy-with-docker.mdx b/mintlify/get-started/self-host/deploy-with-docker.mdx index 90809471f..6b979bc25 100644 --- a/mintlify/get-started/self-host/deploy-with-docker.mdx +++ b/mintlify/get-started/self-host/deploy-with-docker.mdx @@ -51,7 +51,7 @@ If you see `bind: address already in use` error, it means the port 8080 is alrea Due to the vm mechanism of [Colima](https://github.com/abiosoft/colima), try to use the `--mount` option when starting colima as shown below: -```text +```bash mkdir ~/volumes colima start --mount ~/volumes:w ``` diff --git a/mintlify/get-started/self-host/deploy-with-kubernetes.mdx b/mintlify/get-started/self-host/deploy-with-kubernetes.mdx index 90b4dbaba..d7470dee9 100644 --- a/mintlify/get-started/self-host/deploy-with-kubernetes.mdx +++ b/mintlify/get-started/self-host/deploy-with-kubernetes.mdx @@ -72,19 +72,19 @@ spec: 1. Start Bytebase with the following command: - ```text + ```bash kubectl apply -f bytebase.yaml ``` 2. Make sure everything worked by listing your deployments: - ```text + ```bash kubectl get statefulsets ``` Do the same check for your services: - ```text + ```bash kubectl get services ``` @@ -96,7 +96,7 @@ Bytebase provides an official Helm chart for simplified Kubernetes deployments. Deploy Bytebase using Helm with your external PostgreSQL database: -```text +```bash helm -n \ --set "bytebase.option.externalPg.url"={PGDSN} \ --set "bytebase.version"={VERSION} \ @@ -107,6 +107,6 @@ install bytebase-repo/bytebase To remove the Bytebase deployment: -```text +```bash helm delete --namespace ``` diff --git a/mintlify/get-started/self-host/upgrade.mdx b/mintlify/get-started/self-host/upgrade.mdx index acf027da5..5b9f1c642 100644 --- a/mintlify/get-started/self-host/upgrade.mdx +++ b/mintlify/get-started/self-host/upgrade.mdx @@ -28,8 +28,8 @@ Start Bytebase with the new version using your existing Docker run command, upda Execute the following command to create a complete database clone: -```text - psql -h <> -p <> -U <> metadb -c "CREATE DATABASE metadb_backup WITH TEMPLATE metadb;" +```bash +psql -h <> -p <> -U <> metadb -c "CREATE DATABASE metadb_backup WITH TEMPLATE metadb;" ``` ### Restoring from Backup @@ -38,13 +38,13 @@ Execute the following command to create a complete database clone: 2. Preserve the current database by renaming it: - ```text + ```bash psql -h <> -p <> -U <> postgres -c "ALTER DATABASE metadb RENAME TO metadb_old" ``` 3. Restore from your backup: - ```text + ```bash psql -h <> -p <> -U <> postgres -c "CREATE DATABASE metadb WITH TEMPLATE metadb_backup;" ``` @@ -52,7 +52,7 @@ Execute the following command to create a complete database clone: 5. After confirming successful restoration, remove temporary databases: - ```text + ```bash psql -h <> -p <> -U <> postgres -c "DROP DATABASE metadb_old" psql -h <> -p <> -U <> postgres -c "DROP DATABASE metadb_backup" ``` diff --git a/mintlify/get-started/step-by-step/deploy-with-docker.mdx b/mintlify/get-started/step-by-step/deploy-with-docker.mdx index 0ff2fff7f..a93134565 100644 --- a/mintlify/get-started/step-by-step/deploy-with-docker.mdx +++ b/mintlify/get-started/step-by-step/deploy-with-docker.mdx @@ -25,7 +25,7 @@ Visit Bytebase at [localhost:8080](http://localhost:8080/). If you've run Bytebase before, you can reset all data by running this command: -```text +```bash rm -rf ~/.bytebase/data ``` diff --git a/mintlify/integrations/api/authentication.mdx b/mintlify/integrations/api/authentication.mdx index 1d874be6d..94f3adaf9 100644 --- a/mintlify/integrations/api/authentication.mdx +++ b/mintlify/integrations/api/authentication.mdx @@ -25,7 +25,7 @@ You can only copy the key right after creating the service account. The key will You need to obtain the exchange token before calling the API. -```text +```bash export bytebase_url=%%bb_api_endpoint%% export bytebase_account=<>@service.bytebase.com export bytebase_password=<> @@ -37,7 +37,7 @@ bytebase_token=$(curl -v ${bytebase_url}/v1/auth/login \ ## Test API -```text +```bash # List projects curl --request GET ${bytebase_url}/v1/projects \ --header 'Authorization: Bearer '${bytebase_token} diff --git a/mintlify/snippets/tutorials/vcs-change-github.mdx b/mintlify/snippets/tutorials/vcs-change-github.mdx index 27711b75a..fa88ed974 100644 --- a/mintlify/snippets/tutorials/vcs-change-github.mdx +++ b/mintlify/snippets/tutorials/vcs-change-github.mdx @@ -2,7 +2,7 @@ Paste the sql script in it. - ```text + ```sql CREATE TABLE t1 ( "id" INTEGER NOT NULL ); diff --git a/mintlify/tutorials/api-audit-log.mdx b/mintlify/tutorials/api-audit-log.mdx index d594f1bea..acd29dd15 100644 --- a/mintlify/tutorials/api-audit-log.mdx +++ b/mintlify/tutorials/api-audit-log.mdx @@ -54,7 +54,7 @@ https://github.com/bytebase/example-api/tree/main/audit-log 1. Go to subfolder `audit-log`, and run the following commands to start the demo application. - ```text + ```bash pnpm i && pnpm dev ``` diff --git a/mintlify/tutorials/api-issue.mdx b/mintlify/tutorials/api-issue.mdx index 6754a4c57..8c41b0c38 100644 --- a/mintlify/tutorials/api-issue.mdx +++ b/mintlify/tutorials/api-issue.mdx @@ -76,7 +76,7 @@ Below is an example app demonstrating the following APIs: 1. Run the following commands to start the sample application. - ```text + ```bash pnpm i && pnpm dev ``` diff --git a/mintlify/tutorials/api-user-database-permission.mdx b/mintlify/tutorials/api-user-database-permission.mdx index 0473de63f..9a34bf5fd 100644 --- a/mintlify/tutorials/api-user-database-permission.mdx +++ b/mintlify/tutorials/api-user-database-permission.mdx @@ -56,7 +56,7 @@ https://github.com/bytebase/example-api/tree/main/permission-check 1. Go to subfolder `permission-check`, and run the following commands to start the demo application. - ```text + ```bash pnpm i && pnpm dev ```