MySQL Workbench is a unified visual tool, that can be used for SQL development and administration I’m double clicking on the MySQL Workbench Icon to open that up
Here we see the list of MySQL connections we only
have one here but there could be multiple
we have local instance MySQL56 as the title and you
might remember seeing that MySQL56 as the Windows Service Name from the
install MySQL video tutorial I’m clicking on this…
And it’s asking us for a password notice we can only sign in here as the
root user we cannot sign in is cindy, joe, or john. I will type in the root password of Secret1 I’m not going to go into every detail
the MySQL Workbench can do I’m only going to spend a few videos
getting acquainted with it at least enough to create a project
similar to what we did in videos 56 thru 58
We notice over here on the left the databases that we created.
there’s odb81 thru 84 these other three are the test databases I was talking about
in those earlier videos We’ve got Sakila, test, and world
Let’s look at odb84_mysqldb If I click on this arrow, it turns from a
sideways arrow to a downward pointing arrow If I hover over odb84_mysqldb,
we notice there’s a little “i” and a wrench. If I click on the wrench it opens up a window where it will allow
us to specify the characteristics of the
database I’m not really interested in changing
those so I’ll close this and I’m coming over and clicking the “i”
The “i” opens up a tab that has multiple tabs underneath it Here, we’ve got the information about the
database, the tables that are on this database, the columns by table on this database as well as a
types if we have any indexes we’ve got a few
fields that we’re not going to use this tutorial series We’ve got the grants here notice under grants that we’ve got john and cindy, but we
don’t see Joe because Joe isn’t given any access to
the entire database only a table on that database Let’s look at the tables. If I click the arrow next to tables, we see the two
tables that are on the database. They have got an “i”, a wrench, and another thing that
looks like a chart or a table. If I click on this table… executes a select asterisk from – and then table name
and then down below shows us the data If I click on the “i”, it gives us some information
about the table and then the wrench.
If I click on the wrench we can actually make updates to our table I’m going to turn
off his bottom panel by clicking this icon up here on the right. Let’s make a change to the table.
I’ll add in a field MySQL Workbench put in it ColumnName I don’t particularly care for I’m going
to delete that out and put in my own EMP dash addr I’m going to leave the varchar type of 45 We could change that but I’m happy
with what we have then it has some fields over here with
some checkboxes this is for the primary key, Not Null, unique index, couple fields that we’re not
going to use auto increment, and a default value – for that field If I click on the
primary key it also checks Not Null It also adds a check to the box down here
Notice we also have the column name here I’m turning these off we can add in a comment about this field if we like as well
“This is for the employee address”
That’s my comment to apply this change I need to click apply if I click revert
it will go back to what it was before I made any changes Let’s apply it – what this is doing is creating the SQL to make the change just like we saw in earlier
LibreOffice Base tutorials everything is based on SQL.
Let’s click Apply and finish and we have a new column to see if this is added property I’ll come back over here too tables I can click on the columns and we see it
right here employee address going back up to the table EMP If I click on this select table again.
It creates another window and this time it has the new field.
Going back over here we see this is our original this is no
longer valid Let’s X out and I want to add some data to this employee address
I’m going to type in 1234 Derby Lane I need to tab out – so I can apply this again we see that it creates the SQL for this command I’m going to selected it all using control C and cancel out I’m going to revert this back as well I’m coming way back over here to the
query 1 We have nothing in here.
I’m going to paste in the query right click, paste. we see that it’s all and a single line up here we’ve got
his broom – if I hover over it we see that it tells us this is the beautify
reformat the SQL script clicking that reformats the SQL similar to the way that I reformatted
all the SQL in those LibreOffice Base SQL tutorials
We see that we went to update the employee table setting the employee
address to “1234 Derby Lane” where the employee ID equals 1 to execute
this I’ll click on this lightning bolt we need our lower window here back to show that in applied the changes to make sure this
works and coming back over to our employees table and clicking an the table – there we see
1234 Derby Lane has been updated on the database.
Going back over to query one the odd thing I want to point out here is Instead of like we saw in LIbreOffice Base
Where we had double quotes and single quotes – we have to different
single quotes depending on your keyboard you may have
to look around a little bit to find the two different single quotes
needed for this SQL all all cool all all