Guest User

Untitled

a guest
Oct 15th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. import mariadb from 'mariadb';
  2.  
  3. const fn = () => {
  4. mariadb.createConnection({
  5. host: 'localhost',
  6. port: 3306,
  7. user: 'test',
  8. password: 'test',
  9. debug: true,
  10. }).then(conn => {
  11. conn.query('SELECT "Hello there" as Kenobi')
  12. .then(result => result)
  13. .then(conn.destroy());
  14. });
  15. };
  16.  
  17. fn();
  18.  
  19. <== conn:-1 Handshake.parseHandshakeInit (0,106)
  20. 6A 00 00 00 0A 35 2E 35 2E 35 2D 31 30 2E 31 2E j....5.5.5-10.1.
  21. 33 34 2D 4D 61 72 69 61 44 42 2D 30 75 62 75 6E 34-MariaDB-0ubun
  22. 74 75 30 2E 31 38 2E 30 34 2E 31 00 51 00 00 00 tu0.18.04.1.Q...
  23. 41 2E 5E 72 43 36 25 52 00 FF F7 2D 02 00 3F A0 A.^rC6%R...-..?.
  24. 15 00 00 00 00 00 00 00 00 00 00 52 24 5A 7B 7C ...........R$Z{|
  25. 7B 76 5C 4D 49 67 4B 00 6D 79 73 71 6C 5F 6E 61 {vMIgK.mysql_na
  26. 74 69 76 65 5F 70 61 73 73 77 6F 72 64 00 tive_password.
  27.  
  28. ==> conn:81 Handshake.parseHandshakeInit(0,83)
  29. 4F 00 00 01 02 A3 AE 00 00 00 00 40 E0 00 00 00 O..........@....
  30. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  31. 00 00 00 00 66 6D 73 00 14 33 AF 12 C5 84 43 95 ....fms..3....C.
  32. 85 51 6B D4 34 2B F0 20 6D 73 92 34 75 6D 79 73 .Qk.4+. ms.4umys
  33. 71 6C 5F 6E 61 74 69 76 65 5F 70 61 73 73 77 6F ql_native_passwo
  34. 72 64 00 rd.
  35.  
  36. <== conn:81 Handshake.handshakeResult (0,7)
  37. 07 00 00 02 00 00 00 02 00 00 00 ...........
  38.  
  39. ==> conn:81 Query(0,35)
  40. 1F 00 00 00 03 53 45 4C 45 43 54 20 22 48 65 6C .....SELECT "Hel
  41. 6C 6F 20 74 68 65 72 65 22 20 61 73 20 4B 65 6E lo there" as Ken
  42. 6F 62 69 obi
  43.  
  44. $ mysql -u test -ptest
  45. Welcome to the MariaDB monitor. Commands end with ; or g.
  46. Your MariaDB connection id is 83
  47. Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04
  48.  
  49. Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
  50.  
  51. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  52.  
  53. MariaDB [(none)]> select "Hello there" as Kenobi;
  54. +-------------+
  55. | Kenobi |
  56. +-------------+
  57. | Hello there |
  58. +-------------+
  59. 1 row in set (0.00 sec)
  60.  
  61. MariaDB [(none)]>
Add Comment
Please, Sign In to add comment