Why we need user and permissions?
Why not just put user and permissions all at application level rather than database level?
Database can act as a ssh server and application can act as a ssh client.
Database can just set host, port, and ssh public key.
Application just link to the database.
That's all.
Why we need a system for user and permissions?
database is an independent system, it can be accessed with or without applications, regardless of on-premises/off-premises, security is high on the priority list in the corporate infrastructure. Consider an extreme case that a MySQL server is deployed on a public cloud service, using default port and easy password like 'password', I bet it will be hacked within a week, some bitcoins will be needed as the redemption fee then.
I think database is neerly impossible to be set on a public enviroment. Even if it be set on a public enviroment, it not for public use. We can use ways like ssh to connect to the database.
one has permission on OS doesn't mean one should have permission on db, they are different roles. "Nothing worse than a familiar enemy"
I didn't mean we use ssh to connect the database. I mean just use a way like ssh to connect the database rather than using username and password.
Well, there are two dimensions: user system and permission system.
We can use public-private key to replace user system for better security.
We can abandon permission system because in normal case(one application for one database) we don't need it, in special case(multi applications for one database) we can transform it to normal case(database > dbos > app1 + app2)
SSH, especially SSL/TLS are supported by many dbms, they're optional and have no conflict with user/password. eg. MySQL connection methods: https://dev.mysql.com/doc/workbench/en/wb-manage-server-connections.html For TiDB, I'm not sure if it supports SSH/SSL/TLS yet or not.
@xialvjun @tshqin SSL/TLS will be supported in this PR. For most applications, username/password is the standard authentication method.