How do I encrypt my password?

Status
Not open for further replies.

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You don't. Or, rather, if you do, then you also need to keep your encryption key in plain text right alongside the encrypted password, along with the algorithm (and initialization vector, etc.), so the net effect is that you've made things slower without actually accomplishing anything. You can store your password in a configuration file that lives outside of your public_html directory, where your script can get at it, but web users can't.

Please note that the mysql_xxx stuff is deprecated in the current version of PHP as well; you will need to use mysqli_xxx or PDO to avoid problems.
 

socia139

New Member
Messages
5
Reaction score
0
Points
1
Here's the problem:
session_name('SOCIALP_SESSID');
$connection = mysql_connect("localhost","socia139_main","mypassword") or die("Sorry we have an overload with users!");
mysql_select_db("socia139_main");

I have my password as my panel password but it gives me an error like Acces Denied: error connecting to...
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
You need to use the password that you gave to your database user, not your cPanel password.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Go to cPanel
mySQL Databases (where you created the DB)
Create a user, writing down the password
Add user to DB, giving ALL PRIVILIGES

Also, use mysqli_ or PDO. mysql_ is deprecated as of PHP 5.5 and will eventually be removed from PHP.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
I can't it gives me no options

1. Do not use xHosting Basic
2. Are you ADDING the user to the database? And you do not get an options page when you try to add it?
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
The error I'm seeing indicates that the connection pool (the number of active database connections from all users) is exhausted, not that the password isn't working.
 
Status
Not open for further replies.
Top