Solved

Resetting a password for admin in PHP

Posted on 2014-04-02
9
530 Views
Last Modified: 2014-04-28
Hi, we have a PHP intranet site at work, whose admin password is lost, it was build in php and mysql, hosted on Linux, all we have is a root password for Linux, so how can we reset the password for the portal which is hosted on our intranet site?
0
Comment
Question by:Leo
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 2

Expert Comment

by:Puspharaj Selvaraj
ID: 39974264
Sure, you can reset the password.

reset the password via mysql like this

http://askubuntu.com/questions/321903/resetting-forgotten-phpmyadmin-password
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 39974316
That's if your intranet site uses phpmyadmin. If not, use the steps from above to reset mysql root password, then drop Adminer somewhere in your html path and navigate to the page.

Put root and your new password in the Adminer login page, then identify what database is your application using, then identify it's user's table and then modify/add users and passwords.

HTH,
Dan
0
 
LVL 51

Expert Comment

by:Julian Hansen
ID: 39974406
When you say admin password - do you mean the password to the database ro the password to access the system?

If PHP is accessing the database then a user name and password used by the PHP script should be available somewhere in the code - a config file etc.

This will allow you to access the databse.

If your app manages its own security and you are looking for the admin password to the application - i.e. stored in a user table in the database then you can use the credentials as obtained above and use them to access the table where the passwords are stored.

You can then simply (depending on how passwords are stored) enter a new password.

If the password is hashed or encrypted - you can look at the PHP code to see how it is encrypting the password and replicate that process when creating a new value.

If you are wanting to reset the root password to the MySQL database you can find out more on how to do this here

https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
0
 
LVL 8

Author Comment

by:Leo
ID: 39990861
When i say database, i mean username/password to access the web portal on intranet.
On Centos when i enter the command mysql ( to connect to DB to access tables) i get an error 1045 message: Access Denied for user `root1@`localhost` (using password:NO).
Do i have to use different login details to access mysql db?
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 51

Expert Comment

by:Julian Hansen
ID: 39990902
If you don't have the login details - or they are not working then the link in my previous post is the one to look at.

Are you sure root1 exists on the database? default is root?
0
 
LVL 8

Author Comment

by:Leo
ID: 39990918
Those instructions are for windows box, i am running linux through cli...would the same instructions work?
so on centos iam logged in as root. Sorry that was a typo, in the error message its root@,
i have the root password for mysql, but how i should access mysql DB? when i type in #mysql, it gives an error which i posted, is there a different way of connecting to mysql database in centos?
0
 
LVL 8

Accepted Solution

by:
Leo earned 0 total points
ID: 40019242
have resolved the question by myself.
https://www.phpbb.com/community/viewtopic.php?f=46&t=1252135
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40019247
Damn that crystal ball is late in coming. We should of known you're using phpBB, it was so obvious from your post...
0
 
LVL 8

Author Closing Comment

by:Leo
ID: 40026813
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now