Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql -h 127.0.0.1 -u my_user --password='password' db -e "SHOW TABLES;"
- print config.get('repository', 'host') // 127.0.0.1
- print config.get('repository', 'user') // my_user
- print config.get('repository', 'passwd') // password
- engine = getUnaffiliatedEngine()
- print engine //Engine(mysql://my_user:***@127.0.0.1:3306)
- with engine.connect() as connection:
- for s in statements:
- if s.strip():
- connection.execute(s)
- ps -ef | grep mysql
- mysql> select User, Host from mysql.user;
- +------+--------------------------+
- | User | Host |
- +------+--------------------------+
- |my_user 127.0.0.1 |
- | root | 127.0.0.1 |
- | root | ::1 |
- | | localhost |
- | root | localhost |
- +------+--------------------------+
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement