Jump to content

Using Mysql With .htaccess


Recommended Posts



i have been learning PHP and starting to ue mySQL i have read and found coding that .htaccess can read username and passwords on mySQL but i can not get it working, below i hae add the coding that i have found if anyone can help me out i would be very greatful


AuthType Basic

AuthName "Restricted Area"

Auth_MYSQLhost mysql.uk.clara.net

Auth_MYSQLusername *****

Auth_MYSQLpassword *****

Auth_MYSQLdatabase database

Auth_MYSQLpwd_table login

Auth_MYSQLuid_field username

Auth_MYSQLpwd_field password

Auth_MYSQL_EncryptedPasswords off

require valid-user


when i upload this to the website to does not bring up and username and password box like it should, i have been using .htaccess with .htpasswd for a few years now and that works correctly.

Link to comment
Share on other sites

Welcome to the forums sdc121 :(


I have no idea what you are attempting to do nor have I ever tried using MySQL commands in a .htaccess file. Maybe someone else can help.


thanks for getting back to me, do you now the best and most sacure way to sacure a website directory using MYSQL?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...