jzawodn / mytop Goto Github PK
View Code? Open in Web Editor NEWa "top" clone for MySQL
Home Page: http://jeremy.zawodny.com/mysql/mytop/
a "top" clone for MySQL
Home Page: http://jeremy.zawodny.com/mysql/mytop/
Git Version: commit b737f60
mytop version 1.7
CentOS release 6.2 (Final)
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
If ~/.my.cnf has a password line like this:
password='mysecretpassword'
The mysql Client will use it without quotes while mytop won't do that.
Tested on version 1.91
mytop requires character set to be in Index.xml, even if it's an alias and otherwise accounted for with show charset;
Workarounds appreciated.
$ mytop
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/local/share/mysql/charsets/Index.xml' file
Cannot connect to MySQL server. Please check the:
* database you specified "myDB" (default is "test")
* username you specified "myUser" (default is "root")
* password you specified "myPass" (default is "")
* hostname you specified "myServer" (default is "localhost")
* port you specified "myPort" (default is 3306)
* socket you specified "mySocket" (default is "")
The options my be specified on the command-line or in a ~/.mytop
config file. See the manual (perldoc mytop) for details.
Here's the exact error from DBI. It might help you debug:
Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/)
$ mysql -u myUser -p -e 'show charset;'
+----------+-----------------------------+---------------------+--------+
| Charset | Description | Default collation | Maxlen |
+----------+-----------------------------+---------------------+--------+
...
| utf8 | UTF-8 Unicode | utf8_general_ci | 3 |
| utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 |
+----------+-----------------------------+---------------------+--------+
After run command mytop on third line include parameter "Sorts", but on manual not documented what it means. I search description only on CREDITS . Please, correct documentation
Somehow this statistics about the different type of queries can not be correct:
Se/In/Up/De(%): 04/34/01/90
This would be more than 100% in total.
The web site http://jeremy.zawodny.com/mysql/mytop/ does not mention version 1.7; it says the latest is 1.6.
The web site http://freecode.com/projects/mytop does not mention version 1.7; it says the latest is 1.6.
The web site http://search.cpan.org/dist/mytop/ does not mention version 1.7; it says the latest is 1.2.
I get the following error lots of times:
Use of uninitialized value $host in substitution (s///) at ./mytop line 958.
This happens when gethostbyaddr returns null. In that case we should show the IP instead:
From 602d063dbac4ae94b2d2273ceef9fbf01f9ca1d9 Mon Sep 17 00:00:00 2001
From: Christoph Brill <[email protected]>
Date: Tue, 27 Aug 2013 16:11:13 +0200
Subject: [PATCH] If gethostbyaddr return nothing, keep using the IP
---
mytop | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/mytop b/mytop
index fba27fd..8d6bf42 100755
--- a/mytop
+++ b/mytop
@@ -955,8 +955,11 @@ sub GetData()
{
$thread->{Host} =~ s/:\d+$//;
my $host = gethostbyaddr(inet_aton($thread->{Host}), AF_INET);
- $host =~ s/^([^.]+).*/$1/;
- $thread->{Host} = $host;
+ if ($host)
+ {
+ $host =~ s/^([^.]+).*/$1/;
+ $thread->{Host} = $host;
+ }
}
## Fix possible undefs
--
1.8.4
Running mytop 1.7 with MaridDB 10.0.21 and InnoDB tables. OS: Centos 6.7 x86_64
I have noted that if you press shift-I, a blank scren is displated with a highlighted (END).
InnoDB Status [hit q to exit this mode]
Use of uninitialized value in print at /usr/bin/mytop line 1109.
A little searching the web, I found that MaridDB has removed the "SHOW INNODB STATUS" command, this has been replaced with "SHOW ENGINE INNODB STATUS"
Knowledge Base Reference https://mariadb.com/kb/en/mariadb/show-innodb-status-removed/
I may have a crack at adding a conditional check for this one myself but my perl is not the best.
# mytop
Cannot connect to MySQL server. Please check the:
* database you specified "" (default is "")
* username you specified "root" (default is "root")
* password you specified "'foo'" (default is "")
* hostname you specified "localhost" (default is "localhost")
* port you specified "3306" (default is 3306)
* socket you specified "" (default is "")
The options my be specified on the command-line or in a ~/.mytop or
~/.my.cnf config file. See the manual (perldoc mytop) for details.
Here's the exact error from DBI. It might help you debug:
Access denied for user 'root'@'localhost' (using password: YES)
mytop
should trim quotes from the password
Could you create a git tag for version 1.7?
Just apply the following change:
$ git diff
diff --git a/mytop b/mytop
index fba27fd..5bcb59b 100755
--- a/mytop
+++ b/mytop
@@ -1099,7 +1099,7 @@ sub GetInnoDBStatus()
}
}
open P, "|$config{pager}" or die "$!";
print keys %{$data[0]};
The old command is deprecated in 5.5 and not supported anymore with 5.6.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.