Is there a way and how to secure (encrypt) my mysql view'a source code from others, so others can't see how is this view assembled. I know that in mssql this is possible with create view {name} with encryption as ...?
In MySQL, everyone with the permission to use show create view
can view the code of your view.
This will usually include administrators, which you want to prevent to look too. Note though that also for MS SQL, admins can look at encrypted views.
So while your view code is not encryptable, you may be able to hide all relevant logic. You can (at least if the admin trusts you enough to let you add code to their server that they cannot verify to not be malicious) use loadable functions, which mean you can write c++ functions and add them in compiled form as a library, to be used e.g. in a query.
Your view may then just lists the table and columns you use (or not use), while all important calculations are done in compiled c++ code, which should probably protect it from most eyes. E.g. your view may just look like
create view myview as
select myfunc1(a.col1, a.col2, a.col3, b.col1, b.col2, b.col3),
myfunc2(a.col1, a.col2, a.col3, b.col1, b.col2, b.col3)
from employee a join salary b
on myfunc3(a.col1, a.col2, a.col3, b.col1, b.col2, b.col3)
where myfunc4(a.col1, a.col2, a.col3, b.col1, b.col2, b.col3)
which does not reveal that much.
Note though that it is probably uncommon to go to such lengths to protect sql code, but more common to protect the data itself. Nevertheless, this might be a viable solution for your situation.