1

I need to use mysqlcheck cmd for optimizing tables in the database. I've created a Lambda function in python for the whole process, now to execute the whole process first I need to optimize all tables of the database.

I'm using PyMSQL module in python for connecting DB, but I guess optimising tables ability is not provided by PyMSQL, Then I tried to use the subprocess module to run the OS command mysqlcheck, but got the following error:

[ERROR] FileNotFoundError: [Errno 2] No such file or directory: 'mysqlcheck'

Can you tell me is any alternative of mysqlcheck is present in python Or how i can run mysqlcheck CMD in AWS Lambda?

Thank You.

manish soni
  • 515
  • 1
  • 7
  • 19

1 Answers1

0

The alternative is to move your tables away from ENGINE=MyISAM (which sometimes needs OPTIMIZE) to ENGINE=InnoDB (which takes care if itself).

Rick James
  • 135,179
  • 13
  • 127
  • 222