How to run queries on live data
If you need to query the live data (rather than a dump or tools mirror), follow the following steps:
- Go to https://dbtree.wikimedia.org and look for a slave database server that isn't very busy (low lag, few active threads) and has the data you need (See https://noc.wikimedia.org/conf/highlight.php?file=db-eqiad.php)
- ssh to terbium
- Connect to the slave database server with the syntax 'sql <DBNAME> -h <HOSTNAME>', for example sql enwiki -h db1001
- Run your query
You should avoid running queries on the master databases whenever possible. Otherwise you will bog down performance of the live websites. If you absolutely must run a query on a master database, follow these instructions:
- ssh to terbium
- Connect to the master database server with the syntax 'sql <DBNAME>', for example sql enwiki
- Run your query
To check the current status of a database, you can click on its server name in the dbtree chart or log into the server from terbium and run 'show engine innodb status\G'.