% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/read-backends.R
\name{tl_read_mysql}
\alias{tl_read_mysql}
\title{Read from a MySQL/MariaDB database}
\usage{
tl_read_mysql(
  dsn,
  query,
  dbname = NULL,
  user = NULL,
  password = NULL,
  port = 3306,
  ...
)
}
\arguments{
\item{dsn}{A MySQL connection string (e.g.,
\code{"mysql://user:pass@host:port/dbname"}), or the database host if
using named parameters.}

\item{query}{A SQL query string.}

\item{dbname}{Database name (if not in \code{dsn}).}

\item{user}{Username (if not in \code{dsn}).}

\item{password}{Password (if not in \code{dsn}).}

\item{port}{Port number. Default is 3306.}

\item{...}{Additional arguments passed to \code{DBI::dbConnect()}.}
}
\value{
A \code{tidylearn_data} object containing the query results.
}
\description{
Connects to a MySQL or MariaDB database, executes a SQL query, and returns
the result as a \code{tidylearn_data} object. Accepts either a connection
string or individual connection parameters. Requires \pkg{DBI} and
\pkg{RMariaDB}.
}
\examples{
\donttest{
# data <- tl_read_mysql(
#   dsn = "localhost",
#   query = "SELECT * FROM my_table",
#   dbname = "mydb",
#   user = "myuser",
#   password = "mypass"
# )
}

}
