‘PRIMARY’ filegroup is full. How do I increase temdb size in SQL Server Express 2017?
You do not need to increase the size of temp db.  


  in database ‘mydatabase’ because the ‘PRIMARY’ filegroup is full.


Is telling you it can't write to your primary filegroup is full (c:\path to database\mydatabase.mdf).  Either there is no disk space where the MDF is stored, or the more likely cause is that your Primary Filegroup has no more available room to write into.

You can address this a few different ways


Enable autogrowth if not enabled
If autogrowth is enabled increase the maximum size by MB's, percentage or unlimited


In the GUI

In SSMS:


right click your database
select properties 
select files in the database properties window
On the Autogrowth Max Size select your auto growth options.





SQL Alter statement

use master
go
-- Use one of the statements below

-- this statement will allow for unlimited file growth 
alter database [mydatabase] modify file ( name ='mydatabase', maxsize = UNLIMITED)

-- this statement will allow the database size to 100MB's.
alter database [mydatabase] modify file ( name ='mydatabase', maxsize = 102400KB)