Advertisement
Guest User

Untitled

a guest
Jul 8th, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.74 KB | None | 0 0
  1. select user, host, authentication_string from mysql.user;
  2. +-------------+-----------+-------------------------------------------+
  3. | user | host | authentication_string |
  4. +-------------+-----------+-------------------------------------------+
  5. | root | localhost | *D971D136A477A4C205AEF706... |
  6. | mysql.sys | localhost | *THISISNOTAVALIDPASSWORDT... |
  7. | pkg_manager | localhost | *E91158E2E26F343D6639E4BD... |
  8. +-------------+-----------+-------------------------------------------+
  9.  
  10. mysql> show grants for 'pkg_manager'@'localhost';
  11. +-------------------------------------------------------------------------------------+
  12. | Grants for pkg_manager@localhost |
  13. +-------------------------------------------------------------------------------------+
  14. | GRANT USAGE ON *.* TO 'pkg_manager'@'localhost' |
  15. | GRANT SELECT, INSERT ON `panopticon`.`package` TO 'pkg_manager'@'localhost' |
  16. | GRANT SELECT, INSERT ON `panopticon`.`package_history` TO 'pkg_manager'@'localhost' |
  17. +-------------------------------------------------------------------------------------+
  18.  
  19. [~]$ mysql -u pkg_manager -p --database=panopticon
  20. Enter password:
  21. Reading table information for completion of table and column names
  22. You can turn off this feature to get a quicker startup with -A
  23.  
  24. Welcome to the MySQL monitor. Commands end with ; or g.
  25. Your MySQL connection id is 6
  26. Server version: 5.7.13 MySQL Community Server (GPL)
  27.  
  28. Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
  29.  
  30. Oracle is a registered trademark of Oracle Corporation and/or its
  31. affiliates. Other names may be trademarks of their respective
  32. owners.
  33.  
  34. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  35.  
  36. mysql>
  37.  
  38. connection = mysql.connector.connect(option_files='/path/to/options.cnf')
  39.  
  40. mysql --defaults-file="/path/to/options.cnf"
  41.  
  42. [~]$ mysql --defaults-file="/etc/pkg_manager/db_info/options.cnf" -p
  43. Enter password:
  44. Reading table information for completion of table and column names
  45. You can turn off this feature to get a quicker startup with -A
  46.  
  47. Welcome to the MySQL monitor. Commands end with ; or g.
  48. ...
  49. mysql>
  50.  
  51. 1 # Options file for pkg_manager, easy way to "securely" store database login info.
  52. 2 [connector_python]
  53. 3 user="pkg_manager"
  54. 4 password="*********"
  55. 5 database="panopticon"
  56. 6 host="localhost"
  57. 7 unix_socket="/var/lib/mysql/mysql.sock"
  58. 8
  59. 9 [client]
  60. 10 user="pkg_manager"
  61. 11 password="*********"
  62. 12 database="panopticon"
  63. 13 host="localhost"
  64. 14 socket="/var/lib/mysql/mysql.sock"
  65.  
  66. 1 # For advice on how to change settings please see
  67. 2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
  68. 3
  69. 4 [mysqld]
  70. 5 #
  71. 6 # Remove leading # and set to the amount of RAM for the most important data
  72. 7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
  73. 8 # innodb_buffer_pool_size = 128M
  74. 9 #
  75. 10 # Remove leading # to turn on a very important data integrity option: logging
  76. 11 # changes to the binary log between backups.
  77. 12 # log_bin
  78. 13 #
  79. 14 # Remove leading # to set options mainly useful for reporting servers.
  80. 15 # The server defaults are faster for transactions and fast SELECTs.
  81. 16 # Adjust sizes as needed, experiment to find the optimal values.
  82. 17 # join_buffer_size = 128M
  83. 18 # sort_buffer_size = 2M
  84. 19 # read_rnd_buffer_size = 2M
  85. 20 datadir=/data/panopticon
  86. 21 socket=/var/lib/mysql/mysql.sock
  87. 22
  88. 23 skip-networking
  89. 24
  90. 25 # Disabling symbolic-links is recommended to prevent assorted security risks
  91. 26 symbolic-links=0
  92. 27
  93. 28 log-error=/var/log/mysqld.log
  94. 29 log_error_verbosity=3
  95. 30 general-log=1
  96. 31 general_log_file=/var/log/mysql_general.log
  97. 32 pid-file=/var/run/mysqld/mysqld.pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement