Difference between revisions of "MySQL"

From Vrieze Wiki
Jump to navigation Jump to search
m
Line 3: Line 3:
 
  <syntaxhighlight lang="bash">
 
  <syntaxhighlight lang="bash">
 
  # Connect to mysql server
 
  # Connect to mysql server
  mysql --host=<ip.address> --user=<username> --password=<password>
+
  mysql -u<username> -p -h <ip> --ssl-ca=server-ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem
 
  </syntaxhighlight>
 
  </syntaxhighlight>
  

Revision as of 16:34, 18 June 2019

MySQL

Connecting to MySQL server in bash

 # Connect to mysql server
 mysql -u<username> -p -h <ip> --ssl-ca=server-ca.pem --ssl-cert=client-cert.pem --ssl-key=client-key.pem

MySQL commands

 show databases;      # show the databases
 use userdata_schema; # connect to a particular database
 show tables;         # list the tables within the database
 select * from table_name limit 10; # to see what's in a table (first ten entries)
 select * from user_location where user_id='6346669087044735461' order by sample_time desc limit 10;