it is running, but the browser has some settings that disallow it to access localhost
Really? How does that happen? Are you using a computer that has certain settings restricted beyond your control? Every browser that I've ever used can connect to localhost / 127.0.0.1 - with the possible exceptions of Internet Explorer and Safari, but given that they don't run on Linux I haven't used them for aeons.
I'm just wondering whether it is possible to log client information to the server sql database if I use "file:///"
It depends which languages you're using. PHP will only run via an intermediary web server. JavaScript will work.
Even if you don't need PHP and can get by just with JavaScript, I'd caution against it. Your development environment should mirror as closely as possible the environment in which you eventually deploy your work, e.g. if the server where you anticipate deploying your work is running Debian 6, then do your web development on an instance of Debian 6. (this is where virtual machines come in hand.)
Otherwise, you'll be prone to finding that certain things don't work exactly as you expected when your work is set to go live.