Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2225
  • Last Modified:

MySQL script tuning primer in windows machine

How can I run the script to check the variables and performance of MySQL

http://www.day32.com/MySQL/tuning-primer.sh

In a windows machine?

0
lnrivera
Asked:
lnrivera
  • 4
  • 3
  • 2
1 Solution
 
Muhammad WasifCommented:
You can not run this on Windows. This script is made for *nix.
0
 
lnriveraAuthor Commented:
Is there any emulation? or some scripts like this for windows?

0
 
Muhammad WasifCommented:
I have not seen such a script for Windows yet.
0
[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

 
printnix63Commented:
There are implementations of "unix environments" like Cygwin and MKS, but this will still not let you run this script due to the hard coded path names they have inside the script.
I do have some kind of Unix shell implementation, which always claims to not now tput, and then even so I run mysql you cannot run the script without changes due to the path issues.

Basically, what exactly do you need to know about the performance and variables?
When you call "mysql --help" you already get a part of variable info outside the mysql:

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
auto-rehash                       TRUE
character-sets-dir                (No default value)
default-character-set             latin1
compress                          FALSE
database                          (No default value)
delimiter                         ;
vertical                          FALSE
force                             FALSE
named-commands                    FALSE
local-infile                      FALSE
no-beep                           FALSE
host                              (No default value)
html                              FALSE
xml                               FALSE
line-numbers                      TRUE
unbuffered                        FALSE
column-names                      TRUE
sigint-ignore                     FALSE
port                              0
prompt                            mysql>
quick                             FALSE
raw                               FALSE
reconnect                         TRUE
shared-memory-base-name           (No default value)
socket                            (No default value)
table                             FALSE
debug-info                        FALSE
user                              (No default value)
safe-updates                      FALSE
i-am-a-dummy                      FALSE
connect_timeout                   0
max_allowed_packet                16777216
net_buffer_length                 16384
select_limit                      1000
max_join_size                     1000000
secure-auth                       FALSE
show-warnings                     FALSE

Open in new window

0
 
printnix63Commented:
Additionally, when you are logged in, you can easily enlist further parameters that you can check, like "status" that at least provides information if you have "slow queries"

Besides below short view, you can go to:
use INFORMATION_SCHEMA;
show tables;

There you see what information you can query from the database, like e.g.
select * from global_variables;
select * from global_status;

And from there you can also get partial information like:
mysql> select * from global_variables where variable_name like 'SQL%';
(result see below in the code window:)
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear command.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
notee     (\t) Don't write into outfile.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute a SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.18, for Win32 (ia32)

Connection id:          1
Current database:
Current user:           root@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.1.41
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               3306
Uptime:                 8 min 8 sec

Threads: 1  Questions: 3  Slow queries: 0  Opens: 19  Flush tables: 1  Open tables: 12  Queries per second avg: 0.6
--------------
+--------------------------+----------------------+
| VARIABLE_NAME            | VARIABLE_VALUE       |
+--------------------------+----------------------+
| SQL_QUOTE_SHOW_CREATE    | ON                   |
| SQL_LOG_UPDATE           | ON                   |
| SQL_LOW_PRIORITY_UPDATES | OFF                  |
| SQL_NOTES                | ON                   |
| SQL_AUTO_IS_NULL         | ON                   |
| SQL_SELECT_LIMIT         | 18446744073709551615 |
| SQL_BIG_TABLES           | OFF                  |
| SQL_SLAVE_SKIP_COUNTER   |                      |
| SQL_MODE                 |                      |
| SQL_MAX_JOIN_SIZE        | 18446744073709551615 |
| SQL_BIG_SELECTS          | ON                   |
| SQL_BUFFER_RESULT        | OFF                  |
| SQL_LOG_BIN              | ON                   |
| SQL_WARNINGS             | OFF                  |
| SQL_LOG_OFF              | OFF                  |
| SQL_SAFE_UPDATES         | OFF                  |
+--------------------------+----------------------+
16 rows in set (0.01 sec)

Open in new window

0
 
lnriveraAuthor Commented:
We want to know a good values for a Windows XP 64bits with 4GB of RAM (All tables are innodb)
0
 
printnix63Commented:
You mean, you want a base for configuring the database on a Windows XP 64 bit system that has 4GB of RAM ... but what are you doing, what is the database intended for?

When you install the database, you can set up some basic preconfiguration, e.g. depending on how many connections you expect etc. As well, what MySQL Version do you use, as with the newer versions you have improved concurrency etc. I am afraid from the description available we'll not be able to provide much input.

Performance tuning is a lot of looking into the system where you have bottle necks and removing them, checking where you can remove load or provide more resources, but with the given information it is more wild guessing.
0
 
lnriveraAuthor Commented:
Is there any GUI tool to help with a basic tuning?
0
 
printnix63Commented:
Well, you can download from mysql.com the workbench - which is an Administration GUI.
It brings (at least with Mysql 5.1.5x) some references to "Performance BLOG's" and a commandline tool "mysqlprocgrep" that lets you dump some information about connections of users and processes. Not really much, but it's free.

You will as well find there a plethora of documents and discussions, which as well are directed onto how improve performance.
http://www.mysqlperformanceblog.com/?s=mysql+performance

If you are ready to spend some money you could go for the MySQL Enterprise Monitor, which is claimed to provide a lot more information about what the server does and where it spends time ...

You can find other tools, which you can get as a 30 day trial e.g. at
http://www.webyog.com/en/downloads.php#monyog

On regard of your shell script, eventually you can try this one, it is a perl script, and basically, perl is available for windows...

http://rackerhacker.com/mysqltuner/
# For the latest updates, please visit http://mysqltuner.com/
# Subversion repository available at http://tools.assembla.com/svn/mysqltuner/

but I haven't tested it.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now