Use a TAR Package to Deploy StoneDB
Step 1. Install StoneDB
- Download the StoneDB software package.
wget https://github.com/stoneatom/stonedb/releases/download/5.7-v1.0.3-GA/stonedb-ce-5.7-v1.0.3.el7.x86_64.tar.gz
- Decompress the TAR package and install the software.
tar -vxf stonedb-ce-5.7-v1.0.3.el7.x86_64.tar.gz -C /opt/
- Map dependent libraries.
source /opt/stonedb57/install/bin/sourceenv
- Create user mysql and grant user mysql the permissions to access directory /opt.
groupadd mysql
useradd -g mysql mysql
passwd mysql
chown -R mysql:mysql /opt
- Create directories and grant the user permissions to access the directories.
### Create directories.
mkdir -p /stonedb57/install/data
mkdir -p /stonedb57/install/binlog
mkdir -p /stonedb57/install/log
mkdir -p /stonedb57/install/tmp
mkdir -p /stonedb57/install/redolog
mkdir -p /stonedb57/install/undolog
chown -R mysql:mysql /opt
- Initialize the database.
/opt/stonedb57/install/bin/mysqld --defaults-file=/opt/stonedb57/install/my.cnf --initialize --user=mysql
Step 2. Start StoneDB
/opt/stonedb57/install/mysql_server start
Step 3. Change the Initial Password of User root
- Obtain the initial password of user root.
cat /opt/stonedb57/install/log/mysqld.log |grep password
[Note] A temporary password is generated for root@localhost: ceMuEuj6l4+!
# The initial password is ceMuEuj6l4+!
- In a MySQL command-line interface (CLI), log in to StoneDB as user root.
/opt/stonedb57/install/bin/mysql -uroot -p -S /opt/stonedb57/install/tmp/mysql.sock
# Enter the initial password obtained in step 1.
mysql: [Warning] Using a password on the command line interface can be insecure.
- Reset the password for user root.
mysql> alter user 'root'@'localhost' identified by 'stonedb123';
- Grant the remote login privilege to user root.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'stonedb123';
mysql> FLUSH PRIVILEGES;
Step 4. Stop StoneDB
If you want to stop StoneDB, run the following command:
/opt/stonedb57/install/bin/mysqladmin -uroot -p -S /opt/stonedb57/install/tmp/mysql.sock shutdown
# Enter the new password of user root.