matti76 Posted November 5, 2016 Posted November 5, 2016 Hello, I'm returning to my website after a break from it for a few months. I get the following message on the home page: Access denied for user 'matti76'@'localhost' (using password: YES) I've tried to delete the user and create it again, create a new one, tried to change privileges, etc. Some other info if it helps: - When I try to delete the database and/or user, and recreate them under the same names, CPanel tells me they already exist even though I have deleted them? - on the USER_PRIVILEGES table, the user matti76 has NO under IS_GRANTABLE. Sorry if this is something simple that I'm missing - I'm just learning. Any help is much appreciated. I have tried for hours to resolve this, but I'm going round in circles.
wolstech Posted November 5, 2016 Posted November 5, 2016 Try changing your cpanel password, then log out and in again. After that, try recreating the users again.
matti76 Posted November 5, 2016 Author Posted November 5, 2016 Thanks for the quick response. I've changed my CPanel password which has allowed me to recreate the matti76 user this time, so that is a step forward. Unfortunately I still see the same message: Access denied for user 'matti76'@'localhost' (using password: YES) I also deleted the database and have tried to reimport it, but get the following message in phpmyadmin: #1874 - InnoDB is in read only mode. Thanks again for the help, really appreciated.
wolstech Posted November 6, 2016 Posted November 6, 2016 Did you edit your website's code to use the new password you set? The password for the DB user matti76 should be your cPanel password, so changing the cPanel password will change the DB user's password too. Anything that uses that database user will need to be told what the new password is. If it still refuses to work after you've made sure the website code has the right password, make sure they match by changing the cPanel password again and checking the "Synchronize MySQL Password" checkbox to force the DB user's password to change. I don't recommend using your cPanel account as a database user for security reasons, but lets get it working first. #1874 is because InnoDB has gone read only again due to a crash yesterday morning. I'd advise not using InnoDB since many times when MySQL crashes, InnoDB data has a habit of getting lost. I recommend you convert the InnoDB database to MyISAM, which is much more fault-tolerant. We've never lost MyISAM data in our 10+ years of operation. We've lost all of our InnoDB data several times this year alone. You can convert the database to MyISAM as follows. This will also fix the #1874 error:Make a copy of the .sql fileSearch the copy of the .sql file for Engine=InnoDB and replace all instances with Engine=MyISAMCreate a new database.Import the edited copy of the .sql into the database using PhpMyAdmin to restore the content.
matti76 Posted November 6, 2016 Author Posted November 6, 2016 Thanks. I've done all the above steps, and can now import the converted MyISAM dvb.I'll create a new user once I get this working, as you advise. I now get a slightly different message: unable to select database: Access denied for user 'matti76'@'localhost' to database 'databasename' The databasename in question is the old database that I deleted in my original efforts to solve this. I can't create a new one with the same name, as CPanel tells me it already exists. When I create a database with a new name, however, and then import the tables into it from the old db, the message (as above) suggests it's still looking for the old (deleted) database. I have changed the php code to the new database name. All other usernames and passwords are now matched up with cpanel.
wolstech Posted November 7, 2016 Posted November 7, 2016 Since you're able to create and import the data for the database, the database and cP are now working fine. The "already exists" for a deleted DB is normal when you drop a corrupt InnoDB database. The corruption prevents it from dropping fully, and there is indeed no way to reuse the DB name unless a root admin manually clear out the damaged files that stored the database. I'm a bit confused: Is the error seen on your website showing the new or old database name? If it's the old database name, you likely missed a reference to the database name somewhere in your code. If it's the new one, you probably missed a password somewhere in your code.
matti76 Posted November 7, 2016 Author Posted November 7, 2016 Finally, everything is working again. The last problem was just a stupid mistake on my part (uploading to the wrong folder). Thanks again for your help and the great service here at heliohost.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now