Issue in my Drupal site - mysql

I am unable to login admin panel of my site which is developed in Drupal. I had tried the below link, but it's showing as "You are not authorized to login this page"
http://fujisushiflorida.com/?q=admin
After some surfing in net I had tried the below link. It had shown the login page, but the password I had entered is not correct think. So I had planned to change the password in DB. I had gone to phpmyadmin in that selected "user" table and the first reflecting data is the admin data so I had changed the password of that directly in DB also changed the function to MD5 since pwd has been encrypted. Post changing the password I tried to login but getting the error as "unrecognized username and password"
http://fujisushiflorida.com/user
Can you please help me out on this issue.

Not sure how exactly user info is stored, but generally speaking you can install new Drupal site, grab table rows of your admin account there and move them to problematic site, where you lost your account.

In the database check that you have a user with id of 1 and check that their username and email are what you are expecting.
To reset the password:
If your site is sending emails you should just be able to request a new password.
If you can create an anonymous user without admin verification create one with a password. then in the database copy the password from the new user to the number 1 user.
Otherwise create a user on a clean install or dev site and copy over the password from the database.

Try the forgot password on the login screen if your admin has your email address.
If you can SSH into the server your site is hosted on, install drush if you do not have it and use the drush user-login

Related

Wordpress - The username is not registered on this site

I'm hosting a Wordpress instance on a VPS with MariaDB. Everything seemed to work fine until now where I will try to log into my account but it says,
The username {name} is not registered on this site. If you are unsure of your username, try your email address instead.
I've never gotten this error before so I checked the MariaDB and the user is in the wp_users table. I even changed the password to make sure the password was correct. Any help is appreciated! and thank you in advance.
You can also create a new admin user from SSH access into your VPS.
For this:
Go to your website root directory.
Run the following command:
wp user create $username $emailaddress –role=$role
Be sure to replace the ($username and $emailaddress) example values with your own custom values and ($role) the role you would like the user to be configured with. When the command completes running, a password will be returned, as in the example output below:
exampl3#example.com [~/public_html]# wp user create exampl3
admin#example.com –role=administrator Success: Created user 2enter
code here Password: srWCdc3c*(&b
Refer to the table below, to determine what each role’s capabilities are. This will help you to choose which role to set as the user in the command above.
Role Description
Super Admin Can access all administration features (including site
network administration). Administrator => Can access all
administration features (within a single site). Editor => Can publish
and manage posts (including posts by other users). Author => Can
publish and manage their own posts. Contributor => Can write and
manage their own posts (but cannot publish). Subscriber => Can only
manage their profile.
After creating your account, try to log in again.
Hope this will fix your issue.
Regards

mysql 5.6 update password in users db

I Am working on installation of an application which uses MySql 5.6 Database and Tomcat as web server. After successful installation, there were two users found(admin & ascuser) by default. At first, i login(to GUI) with admin user and given (pre-defined) password. Then prompted to change admin password which went good. Later unfortunately i lost the admin password. Then i could not login to GUI. There is no option to reset admin password in GUI. There is no info provided about ascuser. I logged in to the mysql DB as root user. Passwords are hashed.
Here are few queries. Can anyone please suggest how to change/reset the password for admin user? I dont want to create any other users apart from the existing ones.
FYI:
Below are few outputs:
Mysql Query outputs
Users DB
I googled for password() in mysql to reset the admin password. But all in vain. Can any one Please provide some inputs ?
Unfortunately you cant crack the salted hashes .
But yes you can reset the user Password
check this thread How can I decrypt MySQL passwords

Hide my database password

I just discovered that in the file
/etc/dbconfig-common/phpmyadmin.conf
My database admin password is written in clear-text with no encryption.
How can I change that? I noticed online that many people are happy with this. Although I noticed that only root can see the content of this file (its permission is 600), I still would prefer not having clear passwords.
What do you suggest?
If you require any additional information, please ask.
If you are just looking for a solution for phpmyadmin, you could change it to cookie based authentication. then create .htaccess file with db username and password where pasword is stored in encrypted password file. on first call of page you will have to login once with user and password and then a cookie is stored locally so on next call you are straight in again.
procedure also described here (but for windows):
http://robsnotebook.com/xampp-builtin-security
about creating htaccess user:
http://httpd.apache.org/docs/2.2/programs/htpasswd.html

WordPress/Digital Ocean mysql password reset (difficult scenario) I'm stumped

Before I start I'd like to state that I know very little about SQL so bear with me please.
I recently signed up for hosting with digital ocean, I make WordPress websites so I created a droplet and everything was in working order, had my blog running and everything... Last week I made some tweaks to my blog, one of them being the change of username and password. Im usually always logged into my admin panel but I restarted my PC and now I cant get into my admin panel (I've forgotten the username and password.) I tried every option available to me on http://codex.wordpress.org/Resetting_Your_Password (even the emergency.php) but to no avail. The usual password reset email is not working so I figure its because the host is running an ssh server and that causes some interference with the email system.. anyway the only option left that I haven't tried for password reset is the phpmyadmin option, now this is a whole new thing with digital ocean for me. They don't have a cpanel so everything is done via ssh; I was able to figure out the gist of it, and attempted to create a database - now here is where it got tricky... (Since my blog was already up and running shouldn't it already have a database?) Every time I try to create a new SQL username/pass it succeeds in doing so, but then when I attempt to use that password to login to my shell I get this error: ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
It makes no sense to me because I've just created the username and password yet it does not let me login with it. I am honestly beyond confused and THE ONLY REASON I EVEN WANT TO ACCESS PHPmyadmin IS JUST SO I CAN VIEW MY USERNAME AND PASSWORD TO LOGIN TO MY WORDPRESS ADMIN PANEL.
If anyone has an alternative for me to retrieve my username (even just my username would be fine because then I could use the emergency.php option) or how to get into phpmyadmin I would greatly appreciate it!
Thank you so much for your time and efforts in advance, this is very difficult for me.
You didn't mention anything about granting permissions to your MySQL users. From Digital Ocean (https://www.digitalocean.com/community/articles/how-to-create-a-new-user-and-grant-permissions-in-mysql):
CREATE USER 'newuser'#'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'#'localhost';
Rather than trying to read your password, which is most likely encrypted, you should try to change it.
use mysql;
update user set password = password('new-password') where user = 'you';
From your question it looks like you might also be digging for a Wordpress password. I'm not as familiar with that, but I can at least give you some basic guidelines:
show databases (see a list of the databases. try to pick the one that seems logical)
use myWordpressSite;
show tables (see a list of all the tables in that database)
describe thisTableOfInterest; (will display the columns and field types)
select someColumn from thisTableOfInterest;
I hope that helps.

Getting password from CPANEL using phpmyadmin

Good Day
I am a front-end developer, and I know little from MySQL and databases.
I have a Wordpress MySQL database in CPanel. Now I forgot my password, and the password for my user as seen in phpmyadmin is hashed/encrypted.
How do I get the password?
NOTE: I do not have access to the Server since this is a website on a shared hosting account, so doing the following is not possible for me:
See this post on Stack
Stop the MySQL process.
Start the MySQL process with the --skip-grant-tables option.
Start the MySQL console client with the -u root option.
List all the users;
SELECT * FROM mysql.user;
Reset password;
UPDATE mysql.user SET Password=PASSWORD('[password]') WHERE User='[username]';
But DO NOT FORGET to
Stop the MySQL process
Start the MySQL Process normally (i.e. without the --skip-grant-tables option)
when you are finished. Otherwise, your database's security could be compromised.
If your website is working you can probably find the mysql user/password
in the config.php file in your wordpress filesystem.
Otherwise:
Your best option is probably to add a user to the database and give it the needed privileges, to do that:
Click MySQL databases.
Create new user.
Assign new user to your database.
Edit config.php on your wordpress filesystem and change to the new username.
This is sub optimal, but will work.
There is a simple way for you to gain access to your WordPress user info if you don't know the password. I'm assuming you are talking about a WordPress user password retrieval. You need to have access and edit privileges to your database to do this.
-Open up phpMyAdmin or however you prefer to access database tables
-Select your database
-Open the table wp_users
-Under the column 'user_login' you will need to find which entry you want to access. Your username should be in one of the row entries.
-Once found, there will be a 'user_pass' column as well. Now some explaining needs to happen. You cannot retrieve your password without hacking/brute forcing that encryption. These are MD5 hash encrypted passwords. What we are going to do is just simply create a new password here. All you have to do is Google "MD5 Hash generator". I tested this on the first result I found and it worked.
-Once you find a website with a generator just simply type in your password and then retrieve the hash that's given to you. For example I typed in 'password' and I receive '5f4dcc3b5aa765d61d8327deb882cf99' Now we have a new encrypted password to set. If you are worried about sites saving your password entries or hashes just make up a password as a temporary fix. Then you can just login with that and change the password via the WordPress Dashboard later.
-Select the row that your username is in. Click Change/Edit then just copy and paste the entire MD5 Hash into the wp_pass column.(Overwrite the old password btw.) Save/Go/Execute to make sure the table was re-written. In this example I would be pasting '5f4dcc3b5aa765d61d8327deb882cf99' into the column without quotes of course.
-Please be sure to only change the 'wp_pass' entry and to make sure it's corresponding to the correct username.(On the same row)
-Now you should be able to login with your new password.('password')