You are browsing a read-only backup copy of Wikitech. The primary site can be found at wikitech.wikimedia.org
How to run queries on live data
Jump to navigation
Jump to search
If you need to query the live data (rather than a dump or tools mirror), follow the following steps:
- ssh to mwmaint1002
- Connect to the slave database server with the syntax
sql <DBNAME>
, for examplesql enwiki
- 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 mwmaint1002
- Connect to the master database server with the syntax
sql --write <DBNAME>
, for examplesql --write 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 mwmaint1002 and run show engine innodb status\G
.
Querying a specific server
If you need to query a specific replica server, follow the following steps:
- ssh to mwmaint1002
- Connect to the slave database server with the syntax
sql <DBNAME> --host <HOSTNAME>
, for examplesql enwiki --host db1001
- Run your query