Building from source code
This document will guide you build standalone MatrixOne using source code.
Step 1: Install Go as necessary dependency
Click Go Download and install to enter its official documentation, and follow the installation steps to complete the Go installation.
Note: Go version 1.20 is required.
To verify whether Go is installed, please execute the code
go version
. When Go is installed successfully, the example code line is as follows:go version go1.20 darwin/arm64
Step 2: Install GCC as necessary dependency
To verify whether the GCC is installed:
gcc -v
bash: gcc: command not found
As shown in the code, the version of GCC is not displayed, the GCC environment needs to be installed.
Click GCC Download and install to enter its official documentation, and follow the installation steps to complete the GCC installation.
Note: GCC version 8.5 is required.
To verify whether GCC is installed, please execute the code
gcc -v
. When GCC is installed successfully, the example code line is as follows:Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Step 3: Get MatrixOne code
Depending on your needs, choose whether you want to keep your code up to date, or if you want to get the latest stable version of the code.
Get the MatrixOne(Develop Version) code to buildGet the MatrixOne(Stable Version) code to build
The main branch is the default branch, the code on the main branch is always up-to-date but not stable enough.
Get the MatrixOne(Develop Version) code:
git clone https://github.com/matrixorigin/matrixone.git
cd matrixone
Run
make build
to compile the MatrixOne file:make build
Tips: You can also run
make debug
,make clean
, or anything else ourMakefile
offers,make debug
can be used to debug the build process, andmake clean
can be used to clean up the build process. If you get an error likeGet "https://proxy.golang.org/........": dial tcp 142.251.43.17:443: i/o timeout
while runningmake build
, see Deployment FAQs.If you want to get the latest stable version code released by MatrixOne, please switch to the branch of version 0.8.0 first.
git clone https://github.com/matrixorigin/matrixone.git
cd matrixone
git checkout 0.8.0
Run
make config
andmake build
to compile the MatrixOne file:make config
make build
Tips: You can also run
make debug
,make clean
, or anything else ourMakefile
offers,make debug
can be used to debug the build process, andmake clean
can be used to clean up the build process. If you get an error likeGet "https://proxy.golang.org/........": dial tcp 142.251.43.17:443: i/o timeout
while runningmake build
, see Deployment FAQs.
Step 4: Launch MatrixOne server
Launch in the frontend**Launch in the backend**
This launch method will keep the mo-service
process running in the frontend, the system log will be printed in real time. If you’d like to stop MatrixOne server, just make a CTRL+C or close your current terminal.
# Start mo-service in the frontend
./mo-service -launch ./etc/quickstart/launch.toml
When you finish launching MatrixOne in the frontend, many logs are generated in startup mode. Then you can start a new terminal and connect to MatrixOne.
This launch method will put the mo-service
process running in the backend, the system log will be redirected to the test.log
file. If you’d like to stop MatrixOne server, you need to find out its PID
by and kill it by the following commands. Below is a full example of the whole process.
# Start mo-service in the backend
./mo-service --daemon --launch ./etc/quickstart/launch.toml &> test.log &
# Find mo-service PID
ps aux | grep mo-service
[root ~]# ps aux | grep mo-service
root 15277 2.8 16.6 8870276 5338016 ? Sl Nov25 156:59 ./mo-service -launch ./etc/quickstart/launch.toml
root 836740 0.0 0.0 12136 1040 pts/0 S+ 10:39 0:00 grep --color=auto mo-service
# Kill the mo-service process
kill -9 15277
Tips: As shown in the above example, use the command ps aux | grep mo-service
to find out that the process number running on MatrixOne is 15277
, and kill -9 15277
means to stop MatrixOne with the process number 15277
.
Next you can take the next step - Connect to standalone MatrixOne.
Note
The initial startup of MatrixOne approximately takes 20 to 30 seconds. After a brief wait, you can connect to MatrixOne using the MySQL client.
Step 5: Connect to standalone MatrixOne
Install and configure MySQL Client
Click MySQL Community Downloads to enter into the MySQL client download and installation page. According to your operating system and hardware environment, drop down to select Select Operating System > macOS, then drop down to select Select OS Version, and select the download installation package to install as needed.
Note: MySQL client version 8.0.30 or later is recommended.
Configure the MySQL client environment variables:
Open a new terminal window and enter the following command:
cd ~
sudo vim .bash_profile
After pressing Enter on the keyboard to execute the above command, you need to enter the root user password, which is the root password you set in the installation window when you installed the MySQL client. If no password has been set, press Enter to skip the password.
After entering/skiping the root password, you will enter .bash_profile, click i on the keyboard to enter the insert state, and you can enter the following command at the bottom of the file:
export PATH=${PATH}:/usr/local/mysql/bin
After the input is completed, click esc on the keyboard to exit the insert state, and enter
:wq
at the bottom to save and exit.Enter the command
source .bash_profile
, press Enter to execute, and run the environment variable.To test whether MySQL is available:
Method 1: Enter
mysql -u root -p
, press Enter to execute, the root user password is required, ifmysql>
is displayed, it means that the MySQL client is enabled.Method 2: Run the command
mysql --version
, if MySQL client is installed successfully, the example code line is as follows:mysql Ver 8.0.31 for macos12 on arm64 (MySQL Community Server - GPL)
If MySQL is available, close the current terminal and browse the next chapter Connect to MatrixOne Server.
Tips: Currently, MatrixOne is only compatible with the Oracle MySQL client. This means that some features might not work with the MariaDB client or Percona client.
Connect to MatrixOne
You can use the MySQL command-line client to connect to MatrixOne server. Open a new terminal window and enter the following command:
mysql -h IP -P PORT -uUsername -p
After you enter the preceding command, the terminal will prompt you to provide the username and password. You can use our built-in account:
- user: root
- password: 111
You can also use the following command line on the MySQL client to connect to the MatrixOne service:
mysql -h 127.0.0.1 -P 6001 -uroot -p
Enter password:
Currently, MatrixOne only supports the TCP listener.
Info
The login account in the above code snippet is the initial account; please change the initial password after logging in to MatrixOne; see Password Management.