Dear All , I need to manage DB remotely , so i follow tutorial :
sshtunnel.SSH_TIMEOUT = 5.0
sshtunnel.TUNNEL_TIMEOUT = 5.0
with sshtunnel.SSHTunnelForwarder(
('ssh.pythonanywhere.com'),
ssh_username='user', ssh_password='sshpass',
remote_bind_address=(''user.mysql.pythonanywhere-services.com'', 3306)
) as tunnel:
c = DAL('mysql://user:dbpass@127.0.0.1:'+str(tunnel.local_bind_port)+'/dbname',pool_size=0 )
but i can't read anything from db , c.tables return empty list. when i try with mysql.connector :
c = mysql.connector.connect(
user='user', password='dbpass',
host='127.0.0.1', port=tunnel.local_bind_port,
database='dbname',)
cur=c.cursor() , return MySQL Connection not available
What i missing ?
[edited by admin: formatting]