This guide shows how to mount the MySQL8 and videx projects into a container using Docker, creating a debugging environment isolated from the host environment. The code in the container can be affected by local modifications in real-time, facilitating development and debugging.
Note: This guide is currently only applicable for macOS.
Please follow the instructions in Section 1 Preparation in the installation guide.
cd $VIDEX_HOME
docker build -t videx_debug:latest -f build/Dockerfile.debug_env .docker run -dit \
--name clion-videx-gdb \
-p 2222:22 -p 13308:13308 -p 5001:5001 -p 1234:1234 \
-v $MySQL8_HOME:/root/mysql_server \
-v $VIDEX_HOME:/root/videx_server \
videx_debug:latest \
sleep infinityRequired for the First Time. Enter the container and execute the compile command:
cd /root/videx_server/build
chmod +x *.sh
./debug.shOpen the local mysql_server project.
- Go to
Settings→Tools→SSH Configurations - Add a new configuration:
- Host: localhost
- Port: 2222
- User name: root
- Password: root
- Click
Test Connectionto verify the connection
- Go to
Settings→Build, Execution, Deployment→Toolchains - Add a new Remote Host toolchain:
- Name: Remote Host
- C++ Compiler: /usr/local/gcc-9.3.0/bin/g++
- Go to
Settings→Build, Execution, Deployment→Deployment - Add a new deployment configuration:
- Type: SFTP
- SSH Configuration: Use the SSH configured in the previous step
- Root path: /root
- Select
Use rsync for download/...
- In the Mappings tab:
- Local path: Set to the mysql_server path on your local host
- Deployment path: /mysql_server
- Go to
Settings→Build, Execution, Deployment→CMake - Add a new CMake Profile:
- Build type: Debug
- Toolchain: Remote Host
- CMake options:
-DWITH_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DCMAKE_INSTALL_PREFIX=. -DMYSQL_DATADIR=./data -DSYSCONFDIR=./etc -DWITH_BOOST=/root/mysql_server/boost -DDOWNLOAD_BOOST=ON -DWITH_ROCKSDB=OFF -DDOWNLOAD_BOOST_TIMEOUT=3600 -DWITH_VIDEX_STORAGE_ENGINE=1- Build directory: mysql_build_output/build
- Go to
Run/Debug Configurations - Search mysqld and add a new instance
- Name: mysqld-init
- Target: mysqld
- Set the program arguments and working directory
- Click
▶️ to run the mysqld-init
--defaults-file=./etc/my.cnf --initialize-insecure --user=root --basedir=./ --datadir=./data- Go to
Run/Debug Configurations - Search mysqld and add a new instance
- Name: mysqld-run
- Target: mysqld
- Set the program arguments and working directory
- Click
▶️ to run the mysqld-run
--defaults-file=./etc/my.cnf --user=root --basedir=./ --datadir=./data --socket=./mysql_80.sock --port=13308Execute in the container terminal:
/root/mysql_server/mysql_build_output/build/runtime_output_directory/mysql \
-h127.0.0.1 -uroot -P13308 \
-e "CREATE USER 'videx'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; \
GRANT ALL ON *.* TO 'videx'@'%'; FLUSH PRIVILEGES;"Test in your local terminal:
mysql -h127.0.0.1 -P13308 -uvidex -ppassword -e 'SELECT 1;'You will get the following result if all goes well
cd /root/videx_server
python3.9 -m pip install -e . --use-pep517
cd src/sub_platforms/sql_opt/videx/scripts
python3.9 start_videx_server.py --port 5001Switch to mysqld-run, and click debug









