Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix(quickstart): fix MySQL test schema and add docs (#564)

qsliu3e62ac99d192
diff --git a/quickstart/README.md b/quickstart/README.md
index 7dc5a3009d..863eabc6e7 100644
--- a/quickstart/README.md
+++ b/quickstart/README.md
@@ -1,9 +1,31 @@
# Quickstart
This folder stores frequently used databases quickstart.
-Prerequest:
+Prerequisite:
- [Docker](https://docs.docker.com/engine/install)
+## MySQL
+1.
+ ```
+ git clone https://github.com/bytebase/bytebase.git && \
+ cd bytebase/quickstart
+ ```
+
+1. Compose up quickstart.
+ ```
+ docker compose -f mysql-quickstart.docker-compose.yml up
+ ```
+ After services are ready. Open localhost:8080 in brower.
+
+1. In `Instances`, there are 2 prepared MySQL instances both connect to `host.docker.internal:3306`. Choose `MySQL Test`.
+
+ Find `Connection info`, check `Empty` password, and `Test Connection`. You should see `Successfully connected instance.`.
+ `Update` password.
+
+ Next `Create migration schema` (in the top), and choose `Create`.
+
+ Finally `Sync Now` (in the bottom). You should see some test databases.
+
## Clickhouse
1.
```
@@ -22,6 +44,4 @@ Prerequest:
\[Optional\] Set up `Instance Name` or `Environment`.
- Finially `Create` instance.
-
-1. You should see some test databases have been prepared.
+ Finially `Create` instance. You should see some test databases have been prepared.
diff --git a/store/test_schema/mysql/2_blog.sql b/store/test_schema/mysql/2_blog.sql
index 659a380738..b9b6b8ff31 100644
--- a/store/test_schema/mysql/2_blog.sql
+++ b/store/test_schema/mysql/2_blog.sql
@@ -53,6 +53,7 @@ ORDER BY
LIMIT 10;
-- Procedure
+DELIMITER //
CREATE PROCEDURE bytebase_test_blog.author_post_count (IN author_id INT, OUT post_count INT)
BEGIN
SELECT
@@ -61,9 +62,11 @@ BEGIN
author, post
WHERE
author.id = post.author_id AND author.id = author_id;
-END;
+END //
+DELIMITER ;
-- Function
+DELIMITER //
CREATE FUNCTION bytebase_test_blog.author_comment_count (author_id INT)
RETURNS INT DETERMINISTIC
BEGIN
@@ -78,9 +81,11 @@ DECLARE
author.id = comment.author_id
AND author.id = author_id;
RETURN comment_count;
-END;
+END //
+DELIMITER ;
-- Event
+DELIMITER //
CREATE EVENT bytebase_test_blog.increase_author_coin_daily ON SCHEDULE EVERY 1 DAY DO UPDATE author
SET coin = coin + 1;
@@ -95,4 +100,5 @@ BEGIN
updated_ts = NOW()
WHERE
id = OLD.id;
-END;
+END //
+DELIMITER ;