Skip to main content

Use a TAR Package to Deploy StoneDB

Step 1. Install StoneDB

  1. Download the StoneDB software package.
  1. Decompress the TAR package and install the software.
tar -vxf stonedb-ce-5.7-v1.0.3.el7.x86_64.tar.gz -C /opt/
  1. Map dependent libraries.
source /opt/stonedb57/install/bin/sourceenv
  1. 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
  1. 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
  1. 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

  1. 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+!

  1. 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.

  1. Reset the password for user root.
mysql> alter user 'root'@'localhost' identified by 'stonedb123';

  1. Grant the remote login privilege to user root.
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'stonedb123';

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.