Change the SQL backend from SQLite to MySQL.
When first called on an EnsDb
object, the function
tries to create and save all of the data into a MySQL database. All
subsequent calls will connect to the already existing MySQL database.
# S4 method for EnsDb
useMySQL(x, host = "localhost", port = 3306, user, pass)
The EnsDb
object.
Character vector specifying the host on which the MariaDB/MySQL server runs.
The port on which the MariaDB/MySQL server can be accessed.
The user name for the MariaDB/MySQL server.
The password for the MariaDB/MySQL server.
A EnsDb
object providing access to the
data stored in the MySQL backend.
This functionality requires that the RMariaDB
package is
installed and that the user has (write) access to a running MySQL server.
If the corresponding database does already exist users without write
access can use this functionality.
At present the function does not evaluate whether the versions between the SQLite and MariaDB/MySQL database differ.
## Load the EnsDb database (SQLite backend).
library(EnsDb.Hsapiens.v86)
edb <- EnsDb.Hsapiens.v86
## Now change the backend to MySQL; my_user and my_pass should
## be the user name and password to access the MySQL server.
if (FALSE) {
edb_mysql <- useMySQL(edb, host = "localhost", user = my_user, pass = my_pass)
}