Profits Plus modules»programming environment»MySQL database interface»data directory
  • RSS Feed

Last modified on 12/23/2014 1:37 PM by User.

Tags:

data directory

The data directory is where MySQL stores the Profits Plus files. 

For example, moving the order entry detail transaction file oedtrx.dat over to MySQL will create the following 9 files in MySQL's datadir /u/mvs/mysql/250001.

dict_oedtrx_dat.MYD
dict_oedtrx_dat.MYI
dict_oedtrx_dat.frm
oedtrx_dat.MYD
oedtrx_dat.MYI
oedtrx_dat.frm
oedtrx_dat_DEL.MYD
oedtrx_dat_DEL.MYI
oedtrx_dat_DEL.frm

The default mysql data directory is /usr/local/mysql/var/  but we like to change it to the /u/mvs/mysql directory because we are already used to storing our data in /u/mvs.

Example: Change the datadir to /u/mvs/mysql

  • Shutdown the mysql server:
  • login as root and physically move the files by entering the following Unix commands:.

mkdir /u/mvs/mysql
cd /usr/local/mysql/var
cp –r * /u/mvs/mysql

cd /u/mvs/mysql
chown mysql *
chgrp mysql *
chmod 660 *
chmod 700 mysql <---- important

cd /u/mvs/mysql/mysql
chown mysql *
chgrp mysql *
chmod 660 *

cd /u/mvs
chown mysql mysql
chgrp mysql mysql
chmod 777 mysql <---- important

  • cd /u/mvs/mysql    and if there are any database names like our devices i.e.  250001, or 250002 then you'll have to do the following chmod on them:
    • chmod 700 250001     where 250001 is the database name.

     

  • You'll have to modify the datadir and socket parameters in the [client] and [mysqld] sections of the  /etc/my.cnf file to reflect the new location.   You must do this before you re-start the MySQL server again.

[client]
password  = your_password
port          = 3306
socket     = /u/mvs/mysql/mysql.sock      <----- Change this line

 

[mysqld]
port    = 3306
socket  = /u/mvs/mysql/mysql.sock         <----- Change this line
datadir = /u/mvs/mysql/                   <----- Change this line
skip-innodb                               <----- Add this line
pid-file = /u/mvs/mysql/mysqld.pid        <----- Add this line

Comment out all occurrences of  log-bin in the /etc/my.cnf file.   This stops logging.  If you don't do this the disk will fill up with transaction logs that we will never use.

  • RUN needs to know where the new socket is located.  So you'll have to modify the SQL0 device line in the /u/mvs/dsk0/001004/mysql.ini file.

DEVICE=SQL0:,localhost,root,mysql1,,/u/mvs/mysql/mysql.sock