Clean all Mysql Data

/etc/init.d/mysql stop
/etc/init.d/mysql start
mysql -uroot
mysql -uroot   -e “show databases” | grep -v Database | grep -v mysql| grep -v information_schema| grep -v test | grep -v OLD |gawk ‘{print “drop database ” $1 “;select sleep(0.1);”}’ | mysql -uroot
/etc/init.d/mysql stop
rm ibdata1
rm ib_logfile*
rm -rf mysql
mysql_install_db
/usr/bin/mysqld_safe
/usr/bin/mysql_secure_installation

 

Enjoy

Acelerating openbravo Pos cash desk closing

After several years using Openbravo Pos in my family’s business,  My father  says that cash desk closing takes about 5 minutes and growing every day that was a bit annoying.

  • backup database
  • reconfigure my.conf enabling innodb_file_per_table,
  • restart mysql
  • drop database
  • restore
  • and pass a mysqlcheck with optimize option

 

didn’t show a big performance increase.

Finally the solution was adding indexes into tables.

ALTER TABLE TAXLINES ADD INDEX receipt (RECEIPT);
ALTER TABLE TAXLINES ADD INDEX taxid (TAXID);
ALTER TABLE TAXES ADD INDEX category (category);
ALTER TABLE RECEIPTS ADD INDEX money (money);

Point of sale