I installed SSMS 18. I installed a new LocalDB instance by choosing it from the SQL Server Express 2017 installation as it is not yet included in the SSMS 18 installation.
I can't see the images due my shop's policies, but I think that you can achieve your goal in 2 ways.
In SSMS right click the server name and select properties, then go to "database settings" there's a section named "Database default locations" modify to meet your requirements.
As a second option is to specify the datafiles explicity like:
CREATE DATABASE [test]
ON PRIMARY
( NAME = N'test', FILENAME = N'c:\mypath\test.mdf' , SIZE = 8192KB , FILEGROWTH = 65536KB )
LOG ON
( NAME = N'test_log', FILENAME = N'c:\mypath\test_log.ldf' , SIZE = 8192KB , FILEGROWTH = 65536KB )
This error is due to a bug in the file creation path in SQL Express 14.0.100. Follow these steps if you are affected:
Open your favorite CLI (like Command Prompt) and use these sqllocaldb commands. If it says the commands cannot be executed because the instance MSSQLLocalDB does not exist, continue to the next step.
sqllocaldb stop MSSQLLocalDB
sqllocaldb delete MSSQLLocalDB
Update your locally installed SQL Server with the latest Cumulative Update https://www.microsoft.com/en-us/download/confirmation.aspx?id=56128. You can see an overview of updates in the Update Center for Microsoft SQL Server on Technet: https://technet.microsoft.com/en-us/library/ff803383.aspx.
After a succesful update, use the sqllocaldb create command.
sqllocaldb create "MSSQLLocalDB"
Your CLI should prompt that it has created a localdb with version 14.0.300 or higher:
LocalDB instance "MSSQLLocalDB" created with version 14.0.3223.3.
If you successfully updated the local db instance but you are receiving this error after: SqlException: 'Cannot create file 'C:\Users\%USERNAME%\Database.mdf' because it already exists.
, please remove the file in the specified path and try again.