I am running a ReadyNAS 102 and installed MySQL, PHP and phpMyAdmin to setup a database for use with OwnCloud. The first install was successful, but after forgetting some login passwords I decided to go for a full reinstall of the above.
Now, when opening phpMyAdmin, I get the following message:
#1045 Cannot log in to the MySQL server
I understand from other sites that I need to access the config.ini.php file to edit the user details manually (and reset the root), however I have no idea how to access this file on the NAS. Is there a command line access for files on the NAS?
https://www.ostraining.com/blog/coding/error-1045-phpmyadmin/
Related
WP version 5.5.3 - updated days ago
php version 7.3.24
running locally on server
Can not create a backup using duplicator
Occours bothi inside WP admin pages, so internal connections and external through php requests
I am suddenly receiving the following error but have not made any changes to any file on the server, nor within wp itself -
WordPress database error: [Access denied for user 'database-name'#'localhost' (using password: YES)] .
THIGNS I HAVE DONE TO FIX -
I have verified the wpconfig password and the db password match. I actually re-updated the db by copying the password listed in the wpconfig file and pasting it to the db.
Searched a lot of solutions on here
checked that the db is up and running by logging in using MYPHPADMIN
What am I missing and how do I get to the root of the issue that is causing this? No console errors are shown.
Have you considered the possibility of for the likes of using an online SQL instance such as AWS RDS, given the correct permissions for the database to be accessed, or are you running it locally?
I have a weird issue where I'm trying to connect phpMyAdmin to a remote server. It wasn't working at all so I was messing around with mysql in command line on the db server (no phpMyAdmin on the db). I used skip-grant tables so I could reset the root user and add myself as a user with all privileges:
GRANT ALL PRIVILEGES ON *.* TO 'myusr'#'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
I accidentally tried logging into PHPmyadmin at this time and it worked! Full access - can see everything in the remote DB. I know it's connected properly because changes I made in command line were showing in phpMyAdmin on the web server.
Now I stop mysqld_safe and restart the service on the db and everything dies again. I keep getting the unhelpful "Cannot log in to the MySQL server" message on phpMyAdmin without any other information. I tried tracing the connection in phpMyAdmin and setting values to test the db connection and results, but that's not working as well as I hoped.
I'll keep hacking, but I'm hoping someone has an idea what to do in this case? All the values appear to be configured correctly since it DOES connect to the db if I turn off all security. I can log into my user commandline using the same name and pass on the db server.
What else could I be missing?
EDIT: I stopped being dumb and trying to hack phpMyAdmin and made my own test php script that simply runs a mysqli_connect() attempt and returns the detailed error. I'm getting the following:
SQLSTATE[28000] [1045] Access denied for user 'myusr'#'prodserverFQDN' (using password: YES)
Ok. I kept researching while waiting for a response and I found something that works. Apparently I didn't enclose my password in quotes or something when I created the user commandline.
To fix it, I used mysqld_safe --skip-grant-tables on the db server so I could log in with phpMyAdmin. Using phpMyAdmin, I edited the user to change the password (via edit, not SQL to prevent shennanigans). Now I can log in like normal without using the "no security" option on my db server.
I have a server hosted on 000webhost.com
In the file manager there is a public_html folder where I store my website files, but no \usr folder.
Generally I could just access this file through the command line or terminal but this is not the case on this server. Unless there are command line tools that I simply couldnt find (I know it is a linux server);
I ran phpinfo() and the configuration file path was in usr/local/lib but I have no idea how to access that.
Any ideas? Thanks in advance.
Go to http://www.000webhost.com/faq.php look at the section on connecting to MySql. Your solution is likely there.
Here is a synopsis:
If you cannot connect to MySQL server, there could be some causes:
- Incorrect MySQL hostname.
Never use 'localhost' as your MySQL hostname! You can find your MySQL hostname by logging on to members area, entering control panel and clicking on MySQL icon.
- Incorrect MySQL username / password or database name.
You can find / setup MySQL username and database by clicking on MySQL icon from control panel. And you can change MySQL password by clicking on phpMyAdmin icon.
- Database failed to setup.
In a very rare cases MySQL database can fail to setup. To confirm this, please try to enter phpMyAdmin for any database. If you see database there, that means it setup was successful. And if you get access denied error by trying to enter phpMyAdmin, please delete the database and setup the same MySQL database again.
Please note that always you must give about 1 minute for any changes to apply on server.
If you still unable to connect to MySQL you check if it is server or your script problem in this way: if you can enter phpMyAdmin and see you database there, that means everything is working fine on our side. It's a problem with your PHP script.
I'm trying to simply run php artisan migrate --seed on a new Laravel project but everytime I try, I get the error:
SQLSTATE[HY000] [1045] Access denied for user 'appuser'#'localhost' (using password: YES)
I check my database config file and the correct username and password for the database are there.
I check MySQL Workbench, and the correct user is there with all the schema privileges for the same password.
I tried adding the user with privileges under %, localhost and 127.0.0.1 but same access denied error.
I ran a quick check to make sure Laravel was selecting the right environment for the database connection details and it is.
I've created users hundreds of times and never had this problem. This all started after I updated to the latest MySQL Workbench 6.1.7 after the older version stopped working correctly on Windows 8. Sadly, I don't have the option to even go back and test if the old version fixes the problem since it won't work at all.
At this point I can't get any new database users to connect.
The database server is up and running, and every other previously existing user still connects just fine.
Here is the my.ini file.
Any ideas? I'm hoping I'm just tired and missing something obvious here.
by reading the config file.
[client]
password = mysql
port = 3306
socket = "{$path}/mysql/mysql.sock"
i think you need to comment the string with default password. Probaby it affects something.
I have recent MariaDB, and the password string is commented out in every config file example
I had installed wamp server and joomla on my local machine. It was giving phpmyadmin no access error 1045. I followed some instructions on the net and everything was fixed. I had to delete that installation because on error in joomla installation. Now when I am trying to install wamp again I am getting the same phpmyadmin error. Tried everything but could not get it working.
Sounds like you might be using the wrong username, password, or host to log in. Or have a mismatch between what you think it's set as, and what it really is set as in the database.
Or phpmyadmin's config.inc.php file has the wrong account info, or is using the wrong method to log in.
Try another WAMP package and be careful when changing database account info (know what the account's Host field is for, it should always be localhost or 127.0.0.1).
http://en.wikipedia.org/wiki/Comparison_of_WAMPs
Have you tried entering your root password into the config.inc.php file (found in Wamp's apps > phpmyadmin folder)? (Also, have you seen this thread at Wamp's official site?)