
    6hB                     :    d dl Zd dl mZ dZdZdZdZdZd Zd	 Z	dS )
    N)Error	localhost3307root tg_maintain_dbc                      d } 	 t           j                            t          t          t
          t                    } t          d           n)# t          $ r}t          d|            Y d }~nd }~ww xY w| S )N)hostportuserpasswd   資料庫連接成功   資料庫連接失敗)	mysql	connectorconnectr
   r   r   pwdprintr   
connectiones     A/Users/gualin/Documents/wsky_tg_auto_maintain/db/db_connection.pycreate_server_connectionr   
   s    J	+_,,	 - 
 

 	%&&&& + + +)a))********+s   AA 
A1A,,A1c                      d } 	 t           j                            t          t          t
          t          t                    } t          d           n)# t          $ r}t          d|            Y d }~nd }~ww xY w| S )N)r
   r   r   r   databaser   r   )
r   r   r   r
   r   r   r   dbr   r   r   s     r   create_db_connectionr      s    J
+_,, - 
 

 	%&&&& + + +)a))********+s   AA 
A7A22A7)
mysql.connectorr   r   r
   r   r   r   r   r   r        r   <module>r!      sd        ! ! ! ! ! !      r    