MySQL WorkBench Installation Guide
MySQL WorkBench Installation Guide
And if you are running windows, choose the option as shown below, and click on “Go to Download
Page”
3. You will be taken to the page shown below. The first installer option accesses the internet to
download everything whereas the second option has everything pre-installed in the downloaded
file. Hence you see the second is a larger file. You can choose any one of these options.
Page 1
SMU Classification: Restricted
4. If you come across this page, that prompts you to Login or Signup, you can choose to skip and
directly go to download. Click on the link “just start my download”
5. The installer .msi file starts downloading. It might take some time.
6. Go to the downloads folder, right click, and click install. Windows OS’ User Account Control might
seek your permission to install. Click “Yes” as many times as it is prompted. If you come across a
window that prompts for MySQL installer upgrade as shown below, click “No” and proceed.
Page 2
SMU Classification: Restricted
7. The installer window opens. Follow the installation guidelines. Since we need only the MySQL
workbench, we could choose custom installation.
* If you have a previous version of SQL workbench installed you will not see this Setup Type page.
Please proceed to Appendix A (on page 15) to upgrade your MYSQL workbench.
8. At the next window that appears, choose MySQL Workbench in Applications Section as shown below
(move the chosen application to the right tab) and click Next. Your version shown will be MySQL
Workbench 8.0.31.
Page 3
SMU Classification: Restricted
You could optionally choose to download “Samples and Examples” from Documentation section if
needed. In this guide we have not chosen that.
9. The installation runs a certain Check Requirements. MySQL WorkBench needs VC++ redistributables
to be installed on your system. Hence when you are prompted to install VC++, select the product,
click "Execute" and "Install" to the following screens below if encountered.
Page 4
SMU Classification: Restricted
10. After VC++ redistributables are installed, follow the direction, and click “Next” to move on to install
the MySQL WorkBench application.
Page 5
SMU Classification: Restricted
12. Installation for MySQLWorkbench is complete. Since we have the option “Start MYSQL Workbench”
selected, MySQL Server starts, when you click on “Finish” below. (wait a few seconds)
Page 6
SMU Classification: Restricted
Page 7
SMU Classification: Restricted
1. When MySQL Workbench is launched, a screen as shown below appears with a connection (boxed in
red) to the server configured.
2. If you want to create a new local connection to your MySQL Server, click on the plus button shown
(b) Leave the Hostname and Port settings as default as shown above unless you had chosen
different Port number during installation
(c) Give your root account password (if any) by clicking on "Store in Vault"
If you click "Test Connection" you should get a successful pop-up window. If you click "OK" on the
above window (after testing the connection), a new connection will be created.
Page 8
SMU Classification: Restricted
3. Double click on existing or new connection created, enter the password (SQL Server root password)
if any. MySQL Work Bench will be launched and connect the MySQL Server if the service is running.
4. You can run your SQL command in the Query editor space.
5. Click on the lightning symbol to run the command typed. The command that is run (and shown
below) is "show databases". The symbol (lighting with cursor) runs the command that is present
where the cursor is, whereas the symbol (just the lightning) runs all commands present on the
query window.
Congratulations! You have successfully installed, configured and run a query on MySQL Server &
MySQL WorkBench.
Page 9
SMU Classification: Restricted
2. To enable Workbench to delete or update without where clause, uncheck the check box as shown
below. (This has to be done just once. Close and re-launch MySQL WorkBench for the settings to be
"in effect")
Page 10
SMU Classification: Restricted
Go to Edit – Preferences on MySQLWorkBench Menu. In the option SQL Execution under SQL Editor,
check if there is a limit on the number of rows displayed and increase it (see the screen below). Save
setting. Close WorkBench and re-open again. You should be able to see the results.
2. I want to load data using LOAD DATA command. I get the error "1290. The MySQLServer is running
with the –secure-file-priv options…"
MySQL is set with secure-file-priv option that basically limits from which directories one can upload
data. The first step is to find out the directory it is set to.
Run the following command on SQL WorkBench query editor.
show variables like '%secure%'
From the above screenshot it is seen that the directory from which we could upload data is under
"c:\ProgramData\MySQL\MySQL Server 8.0\Uploads\".
Page 11
SMU Classification: Restricted
The folder ProgramData under c:\ is by default hidden. You should make it visible. To do that, go to
Windows Explorer Menu, choose View - Options, you will get a window as shown below. Select the
option "Show hidden files.. " and click "OK" on the pop-up window.
You could now place your data files in the folder set by "secure-file-priv" option and load the data.
3. I have placed my data files in the directory that is set by "secure-file-priv". SQLWorkBench still
throws me the error "1290: The MySQLServer is running with the –secure-file-priv options…"
Page 12
SMU Classification: Restricted
4. While inserting data into a table, I get the error number "1452: Cannot add or update a child row..".
What is the error?
This error occurs when you are inserting data into a table that has Foreign Key (FK) and the values
from the .txt file that you are uploading with does not have the corresponding column. Some
suggestions to get to the root of the issue:
a. Check the order of the columns of the created table and the .txt file, they should match.
b. Check in the data file (.txt file) if there are any empty rows or empty columns in the end (you
could check with an editor like Notepad++. This could cause problem if the last column is a FK
column and when it is empty, there is no match for it in the Primary table.)
c. Check if the FK column is left empty in one or more rows. Leaving FK column empty does not
indicate to MySQL that null has to be inserted.
d. Check the data (.txt) file to see what delimiters are used. Use appropriate delimiter
clauses "FIELDS TERMINATED BY" and "LINES TERMINATED BY".
e. If the column corresponding to the foreign key is the last column in the .txt file, you may get this
error even though the value corresponding the last column exists in the corresponding primary
table. Use LINES TERMINATED BY '\r\n' or '\n' or '\r' in "LOAD infile" command as appropriate.
Depending on the OS that is used while creating the .txt file, the terminating character differs.
5. While loading data using .txt file, how do we indicate that a column value is NULL?
You have to place \N in the .txt (Text) file instead of leaving it blank. MySQL "LOAD infile" command
would treat \N as null when loading data into the database table.
6. While loading data using .txt file, can I indicate certain lines to be loaded?
This inserts the data from line 5 until the last line into the order table. This might be helpful if you
want to append the data when there is an error during previous data loading and you have few lines
of data already loaded.
7. While loading the file that contains date column, I receive the error ‘Error 1292: Incorrect date
value’. How do I handle this?
Page 13
SMU Classification: Restricted
This error is thrown when the table column of data type date does not receive values in the format
yyyy-mm-dd hh:mm:ss
The .txt file from which you are uploading data should have the date (datetime) columns in the
format expected. Another alternative is to use the function str_to_date while loading the data as
explained below.
Suppose you have a table named t_customer that contains two columns cus_id(int), join_date(date)
and the customer.txt file has the date in the format dd/mm/yy you could do the following:
The str_to_date() function requires two arguments: the date(or datetime) string that you want to
convert and the format of the date (or datetime) string
for the specifiers to be used in the second argument format, refer to the link
https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_date-format
Page 14
SMU Classification: Restricted
3. Upon upgrade completion you will see the completion page as below
MySQL WorkBench upgrade is complete. You may proceed to page 8 of this document to learn
about the connection of MySQL Server using MySQL WorkBench.
Page 15
SMU Classification: Restricted
Note this version of MySQL Workbench requires mac OS of version 10.15 or later.
2. Drag the MySQL Workbench icon onto the Applications icon as instructed to install the software.
(you may refer to https://dev.mysql.com/doc/workbench/en/wb-installing-mac.html)
Page 16