Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

MySQL one-click optimization script how to write

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

MySQL one-click optimization script how to write, in view of this problem, this article describes in detail the corresponding analysis and solutions, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Overview

Today, we will mainly share the next rewritten mysql one-click optimization script.

Environmental preparation

Module-MySQLDB

Module-sqlparse

Python version = 2.7.3

Yum install-y MySQL-python tar-xvf sqlparse-0.2.3.tar.gz cd sqlparse-0.2.3 python setup.py build python setup.py install

1. Script

# cat turning_sql.ini [database] server_ip = localhost db_user = turning db_pwd = fsxxx1234 db_name = fsl_prod db_port = 3306 [option] sys_parm = ON sql_plan = ON obj_stat = ON ses_status = ON sql_profile = ON

2. Execution result

Execute the command as follows:

# python mysql_turn.py-p tunging_sql.ini-s' select * from t_ocs_production_management pm,t_ocs_production_lines pl where pm.org_code=pl.ascription_org_code'

3. Output content

You can see that the results after execution are as follows:

This is the answer to the question about how to write the optimization script with one click of MySQL. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 213

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report