@@ -18,23 +18,22 @@ demonstrate how to use **Logfire** with MySQL.
1818First, we need to initialize a MySQL database. This can be easily done using Docker with the following command:
1919
2020``` bash
21- docker run --name mysql \
22- -e MYSQL_ROOT_PASSWORD=secret \
23- -e MYSQL_DATABASE=database \
24- -e MYSQL_USER=user \
25- -e MYSQL_PASSWORD=secret \
26- -p 3306:3306 -d mysql
21+ docker run --name mysql \ # (1)!
22+ -e MYSQL_ROOT_PASSWORD=secret \ # (2)!
23+ -e MYSQL_DATABASE=database \ # (3)!
24+ -e MYSQL_USER=user \ # (4)!
25+ -e MYSQL_PASSWORD=secret \ # (5)!
26+ -p 3306:3306 \ # (6)!
27+ -d mysql # (7)!
2728```
2829
29- This command accomplishes the following:
30-
31- - ` --name mysql ` : gives the container a name of "mysql".
32- - ` -e MYSQL_ROOT_PASSWORD=secret ` sets the root password to "secret".
33- - ` -e MYSQL_DATABASE=database ` creates a new database named "database".
34- - ` -e MYSQL_USER=user ` creates a new user named "user".
35- - ` -e MYSQL_PASSWORD=secret ` sets the password for the new user to "secret".
36- - ` -p 3306:3306 ` maps port 3306 inside Docker as port 3306 on the host machine.
37- - ` -d mysql ` runs the container in the background and prints the container ID. The image is "mysql".
30+ 1 . ` --name mysql ` : This defines the name of the Docker container.
31+ 2 . ` -e MYSQL_ROOT_PASSWORD=secret ` : This sets a password for the MySQL root user.
32+ 3 . ` -e MYSQL_DATABASE=database ` : This creates a new database named "database", the same as the one used in your Python script.
33+ 4 . ` -e MYSQL_USER=user ` : This sets a user for the MySQL server.
34+ 5 . ` -e MYSQL_PASSWORD=secret ` : This sets a password for the MySQL server.
35+ 6 . ` -p 3306:3306 ` : This makes the MySQL instance available on your local machine under port 3306.
36+ 7 . ` -d mysql ` : This denotes the Docker image to be used, in this case, "mysql", and starts the container in detached mode.
3837
3938### Run the Python script
4039
0 commit comments