Is there a way to set a default schema for each user in MySQL and if so how? Where user x would default to schema y and user z would default to schema a.
相关问题
- sqlyog export query result as csv
- NOT DISTINCT query in mySQL
- MySQL: conduct a basic search
- Why sometimes there is one of more gap(s) in the v
- mySQL alter table on update, current timestamp
There is no default database for user. There is default database for current session.
You can get it using DATABASE() function -
And you can set it using USE statement -
You should set it manually -
USE db_name
, or in the connection string.If your user has a local folder e.g. Linux, in your users home folder you could create a .my.cnf file and provide the credentials to access the server there. for example:-
Mysql would then open this file for each user account read the credentials and open the selected database.
Not sure on Windows, I upgraded from Windows because I needed the whole house not just the windows (aka Linux) a while back.