# Feature Request - URI access to MySQL - please support

**URL:** <https://forum.xojo.com/t/feature-request-uri-access-to-mysql-please-support/88113>\
**Category:** Databases\
**Created:** [April 20, 2026, 9:26am UTC](https://forum.xojo.com/t/feature-request-uri-access-to-mysql-please-support/88113 "2026-04-20T09:26:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amy\_Barnes](https://forum.xojo.com/user_avatar/forum.xojo.com/amy_barnes/32/984_2.png) [@Amy\_Barnes](https://forum.xojo.com/u/Amy_Barnes)\
**Post date:** [April 20, 2026, 9:26am UTC](https://forum.xojo.com/t/feature-request-uri-access-to-mysql-please-support/88113/1 "2026-04-20T09:26:39Z")

</div>

I just added a feature request for URI access to MySQL databases.

[https://tracker.xojo.com/xojoinc/xojo/-/issues/81226](https://tracker.xojo.com/xojoinc/xojo/-/issues/81226)

Please consider supporting this request, as URI is common way to access MySQL databases.

---

<div class="post-metadata">

**Author:** ![Anthony\_G\_Cyphers](https://forum.xojo.com/user_avatar/forum.xojo.com/anthony_g_cyphers/32/16862_2.png) [@Anthony\_G\_Cyphers](https://forum.xojo.com/u/Anthony_G_Cyphers)\
**Post date:** [April 20, 2026, 11:56am UTC](https://forum.xojo.com/t/feature-request-uri-access-to-mysql-please-support/88113/2 "2026-04-20T11:56:57Z")

</div>

Until this gets implemented, I have this method from an old(ish) project:

```xojo
Public Function MySQLFromURI(uri as String) As MySQLCommunityServer
  var r As New RegEx
  r.SearchPattern = "^([^:]+)://([^:]+):([^@]+)@([^:/]+):(\d+)/(.+)$"
  
  var m As RegExMatch = r.Search(uri)
  
  if m <> Nil Then
    
    var protocol as String = m.SubExpressionString(1)
    if protocol <> "mysql" then
      raise new DatabaseException( "Invalid URI protocol supplied." )
      Return nil
    end if
    
    var username as String = m.SubExpressionString(2)
    var password as String = m.SubExpressionString(3)
    if username.IsEmpty or password.IsEmpty then
      raise new DatabaseException( "Invalid credentials supplied." )
      Return nil
    end if
    
    var hostname as String = m.SubExpressionString(4)
    var port as Integer = m.SubExpressionString(5).ToInteger
    if hostname.IsEmpty or port = 0 then
      raise new DatabaseException( "Invalid connection details supplied." )
      Return nil
    end if
    
    var database as String = m.SubExpressionString(6)
    if database.IsEmpty then
      raise new DatabaseException( "Invalid database name supplied." )
      Return nil
    end if
    
    var result as new MySQLCommunityServer
    result.UserName = m.SubExpressionString(2)
    result.Password = m.SubExpressionString(3)
    result.Host = m.SubExpressionString(4)
    result.Port = m.SubExpressionString(5).ToInteger
    result.DatabaseName = m.SubExpressionString(6)
    
    Return result
  Else
    raise new RuntimeException( "Invalid URI string supplied." )
  End If
  
  Return Nil
End Function

```

Used as:

```xojo
var m as MySQLCommunityServer
try
  m = MySQLFromURI( uri )
catch de as DatabaseException
  MessageBox( de.Message )
end try

if m <> nil then
  m.Connect
  
  '// Do whatever else here...
end if

```
