Link to home
Start Free TrialLog in
Avatar of Luis N
Luis NFlag for Spain

asked on

MySQL script tuning primer in windows machine

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

In a windows machine?

Avatar of Muhammad Wasif
Muhammad Wasif
Flag of Pakistan image

You can not run this on Windows. This script is made for *nix.
Avatar of Luis N


Is there any emulation? or some scripts like this for windows?

I have not seen such a script for Windows yet.
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

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:
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

Avatar of Luis N


We want to know a good values for a Windows XP 64bits with 4GB of RAM (All tables are innodb)
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.
Avatar of Luis N


Is there any GUI tool to help with a basic tuning?
Avatar of printnix63
Flag of Germany image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial