Differences between revisions 4 and 5
Revision 4 as of 2019-05-13 20:17:04
Size: 662
Editor: PieterSmit
Comment:
Revision 5 as of 2023-05-10 03:02:48
Size: 850
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 34: Line 34:
 * Example count by email {{{
SELECT LastCreated,Email FROM User
WHERE Email LIKE "%@tenable.com"
and LastCreated >= CAST('2023-05-09' as Date)
ORDER BY LastCreated desc;


}}}

mysql (mariadb) command line notes

  • login

    $ mysql -uroot -pmypassword
  • list dbs

    MariaDB [(none)]> show databases;
  • use a db e.g. mysql for users

    MariaDB [(none)]> use mysql ;
  • show tables in db

    MariaDB [shopify]> show tables;
  • look at fields in table

    MariaDB [shopify]> describe <table-name>;
  • view users and host

    MariaDB [mysql]> select user,Host,password from user ;
  • set password in console

    MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@192.168.70.1 IDENTIFIED BY 'mypassword' ;
  • Example count by email

    SELECT LastCreated,Email FROM User 
    WHERE Email LIKE "%@tenable.com" 
    and LastCreated >= CAST('2023-05-09' as Date) 
    ORDER BY LastCreated desc;

...

MySql (last edited 2023-05-11 20:57:01 by PieterSmit)