MySQL 1 is one of the most popular databases in use today. It can
be connected to the getML engine using the function
connect_mysql(). But first, make sure your
database is running, you have the corresponding hostname, port as well
as your user name and password ready, and you can reach it from via
your command line.
If you are unsure which port or socket your MySQL is running on, you can start the mysql command line interface
and use the following queries to get the required insights.
> SELECT @@port; > SELECT @@socket;
Import from MySQL¶
By selecting an existing table of your database in the
from_db() class method, you can create a new
DataFrame containing all its data.
Alternatively you can use the
read_query() methods to replace
the content of the current
DataFrame instance or
append further rows based on either a table or a specific query.
Export to MySQL¶
You can also write your results back into the MySQL database. By
providing a name for the destination table in
getml.pipeline.Pipeline.transform(), the features generated
from your raw data will be written back. Passing it into
getml.pipeline.Pipeline.predict() generates predictions
of the target variables to new, unseen data and stores the result into
the corresponding table.