No. it's a Bad Thing to have the htpassword file under the documentroot, although it will work. That file will contain username(s) with encrypted password, so ideally it has to reside somewhere on the server where it will not be visible to the web.
The location of your .htaccess file, which tells the webserver which directory to protect, should be in the directory you want protected, so probably not public_html/.htaccess, but public_html/phpmyadmin/.htaccess
You can't just write a file phpmeadmin.htpasswd, but what I wrote was the command to create one.
'root@mymachine>' is the prompt of the unix shell when you telnet/ssh to it.
/usr/local/bin/htpasswd -c /somepathoutsidethewebfiles/phpmyadmin.htpasswd myusername mypassword
is the command you type to generate the htpasswd file.
/usr/local/bin is the directory (on some systems, for example linux) where the webserver executable files are stored, among which the 'htpasswd' script which generates htpasswd files.
The '-c /path/file' option tells the script to create a new htpasswd file.
The htpasswd examples I used are typical for Apache 1.3.x.