Tag Archives: db

mongo mongoshell query examples

mongo mongoshell query examples

db.MYTABLE.find()
db.MYTABLE.find({}).count
db.MYTABLE.find({}).limit(10)
db.MYTABLE.find({"name":"a"})
db.MYTABLE.find({"name":"a"},{name:1})
db.MYTABLE.find({"name":"a"}).sort({name:1})
db.MYTABLE.remove({"name":"a"})

 

Advertisements

percona mongo db yum install #devops #dba #sysadmin

percona mongo db yum install

https://www.percona.com/doc/percona-server/5.5/installation/yum_repo.html

yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm

yum install Percona-Server-MongoDB


MS SQL Server SQLExpress 2014 TCP/IP

MS SQL Server 2014 SQL Express 2014 TCP/IP connections

SQL Server 2014 / SQL Express 2014

  • Enable MS SQL Server TCP/IP connections
  • Restart MS SQL Server
  • Check MS SQL Server Log for port being used
  • This may not be 1433 but might be 49445 instead
  • Enable port through firewall

SQL Server Client

  • Run Sql Server 2014 Managerment Studio
  • Connect via Server Name or IP and specify Port after a comma
    • MYSERVER,1433
    • 10.10.10,10,49445

GNU/Linux PHP PDO MS SqlServer & ODBC connectors and drivers

GNU/Linux PHP PDO MS SqlServer & ODBC connectors and drivers

mariadb, mysql and percona 5.5 general query and slow query logging

mariadb, mysql and percona 5.5 general query and slow query logging

mysql> select @@general_log;
+---------------+
| @@general_log |
+---------------+
|             1 |
+---------------+


mysql> select @@general_log_file;
+-------------------------------+
| @@general_log_file            |
+-------------------------------+
| /var/lib/mysql/data/query.log |
+-------------------------------+


mysql> select  @@slow_query_log;
+------------------+
| @@slow_query_log |
+------------------+
|                1 |
+------------------+


mysql> select @@slow_query_log_file;
+------------------------------------+
| @@slow_query_log_file              |
+------------------------------------+
| /var/lib/mysql/data/mysql-slow.log |
+------------------------------------+