SA-MP Forums Archive
Password security - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Password security (/showthread.php?tid=477315)



Password security - Pupak - 23.11.2013

Hello! How to secure password when connecting to (for example) MySQL server?

Код:
#define MYSQL_PASS "password"
mysql_connect(... MYSQL_PASS ...)
Obviosuly this is not the correct way to do it, so which is?


Re: Password security - ikbenremco - 23.11.2013

Use this:

PHP код:
#define mysql_host "127.0.0.1" //Has to be a string
#define mysql_user "root" //Has to be a string
#define mysql_password "" //There is none for wamp unless you set one.
#define mysql_database "sa-mp" //Has to be a string 
PHP код:
mysql_connect(mysql_hostmysql_usermysql_databasemysql_password); 



Re: Password security - Pupak - 23.11.2013

Did you even read my post?

Edit: Nevermind, solution found - I'm using protected file (db_credentials.cfg), read from it and then connect to the server.