Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select user, host, authentication_string from mysql.user;
- +-------------+-----------+-------------------------------------------+
- | user | host | authentication_string |
- +-------------+-----------+-------------------------------------------+
- | root | localhost | *D971D136A477A4C205AEF706... |
- | mysql.sys | localhost | *THISISNOTAVALIDPASSWORDT... |
- | pkg_manager | localhost | *E91158E2E26F343D6639E4BD... |
- +-------------+-----------+-------------------------------------------+
- mysql> show grants for 'pkg_manager'@'localhost';
- +-------------------------------------------------------------------------------------+
- | Grants for pkg_manager@localhost |
- +-------------------------------------------------------------------------------------+
- | GRANT USAGE ON *.* TO 'pkg_manager'@'localhost' |
- | GRANT SELECT, INSERT ON `panopticon`.`package` TO 'pkg_manager'@'localhost' |
- | GRANT SELECT, INSERT ON `panopticon`.`package_history` TO 'pkg_manager'@'localhost' |
- +-------------------------------------------------------------------------------------+
- [~]$ mysql -u pkg_manager -p --database=panopticon
- Enter password:
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Welcome to the MySQL monitor. Commands end with ; or g.
- Your MySQL connection id is 6
- Server version: 5.7.13 MySQL Community Server (GPL)
- Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
- Oracle is a registered trademark of Oracle Corporation and/or its
- affiliates. Other names may be trademarks of their respective
- owners.
- Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
- mysql>
- connection = mysql.connector.connect(option_files='/path/to/options.cnf')
- mysql --defaults-file="/path/to/options.cnf"
- [~]$ mysql --defaults-file="/etc/pkg_manager/db_info/options.cnf" -p
- Enter password:
- Reading table information for completion of table and column names
- You can turn off this feature to get a quicker startup with -A
- Welcome to the MySQL monitor. Commands end with ; or g.
- ...
- mysql>
- 1 # Options file for pkg_manager, easy way to "securely" store database login info.
- 2 [connector_python]
- 3 user="pkg_manager"
- 4 password="*********"
- 5 database="panopticon"
- 6 host="localhost"
- 7 unix_socket="/var/lib/mysql/mysql.sock"
- 8
- 9 [client]
- 10 user="pkg_manager"
- 11 password="*********"
- 12 database="panopticon"
- 13 host="localhost"
- 14 socket="/var/lib/mysql/mysql.sock"
- 1 # For advice on how to change settings please see
- 2 # http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
- 3
- 4 [mysqld]
- 5 #
- 6 # Remove leading # and set to the amount of RAM for the most important data
- 7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
- 8 # innodb_buffer_pool_size = 128M
- 9 #
- 10 # Remove leading # to turn on a very important data integrity option: logging
- 11 # changes to the binary log between backups.
- 12 # log_bin
- 13 #
- 14 # Remove leading # to set options mainly useful for reporting servers.
- 15 # The server defaults are faster for transactions and fast SELECTs.
- 16 # Adjust sizes as needed, experiment to find the optimal values.
- 17 # join_buffer_size = 128M
- 18 # sort_buffer_size = 2M
- 19 # read_rnd_buffer_size = 2M
- 20 datadir=/data/panopticon
- 21 socket=/var/lib/mysql/mysql.sock
- 22
- 23 skip-networking
- 24
- 25 # Disabling symbolic-links is recommended to prevent assorted security risks
- 26 symbolic-links=0
- 27
- 28 log-error=/var/log/mysqld.log
- 29 log_error_verbosity=3
- 30 general-log=1
- 31 general_log_file=/var/log/mysql_general.log
- 32 pid-file=/var/run/mysqld/mysqld.pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement