This section describes the installation of MySQL on Windows(64-bit) and connection from R, but versions are available for Mac, Linux, and several other operating systems.
MySQL provides several configuration methods, but, in general, we can create a my.ini file in the “C:\mysql-8.0.16-winx64” folder. The content of my my.ini file looks like the following:
[mysql]
default-character-set=utf8
[mysqld]
port = 3306
basedir=C:\mysql-8.0.16-winx64
max_connections=20
character-set-server=utf8
default-storage-engine=INNODBRemember to change these folder locations if you have installed MySQL elsewhere.
Before runing MySQL in the first time, it should be installed.
mysqld -install in the command line cd C:\mysql-8.0.16-winx64
mysqld -installnet start mysql in the command line cd C:\mysql-8.0.16-winx64
net start mysqlmysql -u root -p. The following figure is shown.NOTE: When you type mysql -u root -p in the command , you will see ‘Enter password’. Press enter in the first time.
use mysql:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Your New Password';
FLUSH PRIVILEGES; show databases; on the command line. After accepting the licensing agreement, choose the installation type. The Typical installation provides the standard files needed to connect to a MySQL database using ODBC. The Complete option installs all the available files, including debug and utility components. Oracle recommends choosing one of these two options to complete the installation. If you choose one of these methods, click Next, then proceed to step 5.
You can also choose a Custom installation, where you select the individual components to install. If you choose this method, click on Next, then proceed to step 4.Once the files are copied to their final locations and the drivers registered with the Windows ODBC manager, the installation is complete. Click on Finish to exit the installer.
On this tutorial, you will see how to create an ODBC Connection to MySQL Server. Windows 10 is used.