?
Solved

Resetting a password for admin in PHP

Posted on 2014-04-02
9
Medium Priority
?
631 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 35

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 58

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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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
 
LVL 58

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 35

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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

762 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