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
Solved

Resetting a password for admin in PHP

Posted on 2014-04-02
9
561 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 55

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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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 55

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
The viewer will learn how to dynamically set the form action using jQuery.

808 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