Can connect from PHP but not from Linux Redhat console - mysql

I'm trying to get access to my mysql DB from linux RedHat console. All the tome I'm getting:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES).
Obviously it seems that the root password is incorrect, but it isn't, because I can connect without no problems from the Website. All the PHP configuration files from several installed frameworks are using the same configuration parameters.
I'm using the following to connect from console:
mysql -u root -p
When the console prompts the password I can't get access.
Any idea?
Thank you very much in advance.
Jordi

Did you try resetting the password for root#localhost? Might be fastest way to solve this.

check if php connects from the same machine/ip and if mysql binds address 0.0.0.0.
dev.mysql.com/doc/refman/5.1/en/… : For example, if you bind to 0.0.0.0, you can connect to the server using all existing accounts. But if you bind to 127.0.0.1, the server accepts connections only on that address. In this case, first make sure that the 'root'#'127.0.0.1' account is present in the mysql.user table so that you can still

Related

ERROR 1045 (28000): Access denied for user 'root'#'localhost' (USING PASSWORD = NO) issue Freeradius server causing aborted connexion

Hi I'm trying to get a mariadb/freeradius/daloradius server up but i keep getting this log from systemctl -xe on my mariadb/mysql service, i came across that after figuring it was the sql connection that was problematic, freeradius shows me the same :
I'm getting frustrated, i ran across almost every config file, all should be in order but no this keeps happening, the radius server is trying to connect to my root sql user when i pointed to him in his config file that he should use the one i created especially for him and i can't manage to understand why, do mariadb needs the root credentials before even allowing it to connect to it ? I'm clueless please help.
This message tell you. that either the credentials in your config is not ok or that root user is not authorized to login.
Best practice is to take your mysql config and try to connect with the mysql command:
mysql -h yourconfigurationhost -u yourconfiguration user -p yourconfiguration password yourconfigurationdatabase
Be shure doing this with your application user.

RDS Mysql ERROR 1045 (28000): Access denied for user #IP (using password: YES)

[This is not a duplicate question]
I have created a RDS MySQL instance with same Security Policy and under same VPC as my EC2 instance.
However when i am trying to access the Instance from EC2 machine i am getting error:
ERROR 1045 (28000): Access denied for user 'User'#'IP' (using password: YES)
Not sure if i am missing Anything.
In MYSQL setup we can resolve this error with added Privileges for User on the IP.Not sure how can we resolve this since i am unable to access the Instance itself.
Anyone faced this issue before?.
I have followed the Document: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.NonRDSRepl.html#MySQL.Procedural.Importing.Create.RDS.Database
mysql -h dandy-dbamazonaws.com[...] -u root -p
-h - put your endpoint
-u - username you set for your local mysql (root in my case). Don't confuse it with instance name
-p - after you hit 'enter' enter the password for your instance (the one you set up during instance creation)
hope it will work! that's how I resolved this issue
Maybe late but I had the same problem today.
Confirm the MasterUsername, with the AWS CLI running aws rds describe-db-instances or in the web console, showing the cluster details on the configuration tab.
Confirm the password, if you are using linux consoles (bash) some some characters may be problematic like # or !.
If you are using ssl connection you can't use --ssl-mode=DISABLED. You have to use --ssl-mode=VERIFY_CA (if you are connecting to endpoint) or --ssl-mode=VERIFY_IDENTITY (OR VERIFY_CA) if are connecting to server endpoint.
The goofy ones always get you: I experienced the same problem after changing the master password but let slip the important fact that by default changes don't take effect until the next maintenance window.
In my scenario I was connecting to an Aurora MYSQL serverless v2
Check you are connecting to the cluster writer instance endpoint
Modify the master password and apply changes immediately

Cannot connect remotelly to a mariadb server

I'm trying to connect to a mariadb server remotelly using terminal, but I get a little issue about that.
Preconditions
I have connection to my remote server, and I can enter inside maria db using the next command
mysql -u root -p**** and I enter without problems.
Also I have commented this line of my.conf from the #bind-address = 127.0.0.1.
When I'm trying to do this from my computer mysql -u root -h mariadb.testing.des -p**** I get the following error in console
ERROR 1045 (28000): Access denied for user 'root'#'mariadb.testing.des' (using password: YES)
Why am I getting two different results using the same user? What am I doing wrong?
Thanks for the help,
Jaster.
It's not enough to ensure your server is reachable from remote. You also have to create a user which has privileges for the remote access to your desired schema. I strongly recommend not to create a remote root user with access to all. Best practice is to create a remote user for every single scheme.
In example:
CREATE USER 'jeffrey'#'my.remote.host' IDENTIFIED BY 'mypass';
GRANT ALL ON jeffreys_db.* TO 'jeffrey'#'my.remote.host';
See also:
https://dev.mysql.com/doc/refman/5.7/en/create-user.html
https://dev.mysql.com/doc/refman/5.7/en/grant.html

Access denied for user 'root'#'localhost' (using password: YES) EVEN when the Password works on PhpMyAdmin

I have an issue with accessing MySQL using root and password.
I am trying to connect the Server using PuTTY SSH using
> mysql u root -p
For an unknown reason I can NOT access the Database and I am getting rejected with the following ERROR:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
The weird thing is that I am using the same password with PhpMyAdmin using Web and I can access everything. I need to run a script that will allow the SQL server
root#localhost user
run the query over the LAN and not the web.
Therefore I need the user to connect using command line SSH or something like that.
How can I fix that issue? the user rott and password WORKS just fine through PhpMyAdmin and not through SSH PuTTY, Why?
Is there something I need to do in order to fix this? I have been working with the Database for 2 years now using the web interface. Now I need to have it working using SSH (22).
Please assist.
thanks in advance.
Arye
It sounds like you need to update the your password for root on MySQL.
Check here: MySQL - ERROR 1045 - Access denied
Thank you all for your help. I have managed to overcome the issue: (see below)
That was FIXED Only when I changed from old password to new. in my.cnf file I have removed the flag for old_password=1 and Restart the service of MySQL.
Then I have created a NEW password (using the old one I had) and it was created with 41 (NEW) Hash length and not 16 (OLD)..
Then I did flush privileges as you recommended - and IT WORKS.
Thank You!
> mysql -h your_host_name -P your_port_number -u your_user_name -p
try with hostname option it should work!
Ubuntu 18.04 running MySQL 5.7.28 creates a file /etc/mysql/debian.cnf. It contains some credentials and other settings. So, this debian-sys-maint user is by default a root equivalent. It is used by certain maintenance scripts on Debian systems, and as a side-effect, allows users with root access on the box to view the plaintext password in /etc/mysql/debian.cnf. If your SSH using a client fails after a fresh install through root try using the credentials set in this file.

Problem starting up mySQL

I just downloaded PHP and I tried running mySQL with the command:
C:\Program Files\EasyPHP-5.3.2i\mySQL\bin\mysql.exe
And I got the error:
ERROR 1045 (28000): Acess denied for user 'ODBC'#localhost' (using password: YES)
I found a solution online with linux, but I'm running vista on this machine and have no clue what all of that meant. Please help, I'm tired of using the school's terminals.
It means one of three likely things.
you need to either create a new user in mysql with the password you are using
set the password of the "ODBC" user to what you are using
grant permission to the host you are attempting to connect from, in this case localhost
Without more information to your specific setup it will be very difficult to answer with more accuracy.
Have you tried supplying the username to the command, for example:
C:\Program Files\EasyPHP-5.3.2i\mySQL\bin\mysql.exe -u root
?
Check the manual Connecting to and Disconnecting from the Server