@@ -14,6 +14,7 @@ def list_params() -> bool:
1414 {"name" : "user" , "type" : "string" , "required" : True , "default" : "root" , "description" : "" },
1515 {"name" : "password" , "type" : "string" , "required" : False , "default" : "" , "description" : "leave blank for no password" },
1616 {"name" : "host" , "type" : "string" , "required" : True , "default" : "localhost" , "description" : "" },
17+ {"name" : "port" , "type" : "int" , "required" : False , "default" : 3306 , "description" : "MySQL server port (default 3306)" },
1718 {"name" : "database" , "type" : "string" , "required" : True , "default" : "mysql" , "description" : "" }
1819 ]
1920 return params_list
@@ -25,23 +26,24 @@ def auth_instructions() -> str:
2526
26271. Local MySQL Setup:
2728 - Ensure MySQL server is running on your machine
28- - Default connection: host='localhost', user='root'
29+ - Default connection: host='localhost', user='root', port=3306
2930 - If you haven't set a root password, leave password field empty
3031
31322. Remote MySQL Connection:
32- - Obtain host address, username, and password from your database administrator
33+ - Obtain host address, port, username, and password from your database administrator
3334 - Ensure the MySQL server allows remote connections
3435 - Check that your IP is whitelisted in MySQL's user permissions
3536
36373. Common Connection Parameters:
3738 - user: Your MySQL username (default: 'root')
3839 - password: Your MySQL password (leave empty if no password set)
3940 - host: MySQL server address (default: 'localhost')
41+ - port: MySQL server port (default: 3306)
4042 - database: Target database name to connect to
4143
42444. Troubleshooting:
4345 - Verify MySQL service is running: `brew services list` (macOS) or `sudo systemctl status mysql` (Linux)
44- - Test connection: `mysql -u [username] -p -h [host] [database]`
46+ - Test connection: `mysql -u [username] -p -h [host] -P [port] [database]`
4547"""
4648
4749 def __init__ (self , params : Dict [str , Any ], duck_db_conn : duckdb .DuckDBPyConnection ):
@@ -54,7 +56,7 @@ def __init__(self, params: Dict[str, Any], duck_db_conn: duckdb.DuckDBPyConnecti
5456
5557 attatch_string = ""
5658 for key , value in self .params .items ():
57- if value :
59+ if value is not None and value != "" :
5860 attatch_string += f"{ key } ={ value } "
5961
6062 # Detach existing mysqldb connection if it exists
0 commit comments