How to solve My SQL ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES) - sql

I know there are already similar questions and I tried each of the solutions but somehow nothing seems to help. Maybe anyone has an idea what is going on. I am very new to the programming world and don't understand yet what's behind all the commands, but tried my best to solve it myself.
I installed MySQL via homebrew on a mac. As long as the password was not set up and I could just press enter when asked for password all was fine. Then I changed the password via this command
mysql> ALTER USER 'root'#'localhost' IDENTIFIED BY '';
After doing this, I could not log in any more and always get the ERROR 1045 (28000). I reinstalled SQL and also downloaded another version via Then I installed SQL via the MySQL community server, but this also did not change anything.
But by installing via MySQL community I could go to the system preferences and reset the password (which also did not work via the terminal) - but again no luck.
I would appreciate any ideas. Thanks.

The issue is likely due to socket authentication being enabled for the root user by default when no password is set, during the upgrade to ubuntu 16.04.
The solution is to revert back to native password authentication. You can do this by logging in to MySQL using socket authentication by doing:
sudo mysql -u root
Once logged in:
ALTER USER 'root'#'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
which will revert back to the native (old default) password authentication.
Now use password as the password whenever required by MySQL.

Related

Error in Connection Testing in Mule Database connector

I am trying to connect mysql database with mulesoft database connector, but it is giving error while I do test Connection. I am not able to figure out what is wrong I am doing. Could you please put me in right direction?
Please ask for more information you need from me.
The problem you are facing is not because of Mule component.There may be several other reasons at MySQL side.
As you can see that your credentials are processed by MySQL however denied.This suggests that the problem may not be directly
related with credentials because if credentials were wrong the error would have been different then denied.
When credentials are denied, the problem is mostly related with:
Permission issue - Solution >> Grant permission to use "db_name" from "Localhost"
Your connection string looks fine but sometimes string encoding result this error
Some installed components are interfering with MySql -> Check the components installation
Also
LOCALHOST and "machine name" aren't the same to MySQL.
I'd check from the command line that you can connect to localhost:
mysql --user=<user_name> --password db_name
Enter password: your_password
If it fails, connect and run this with the appropriate permissions:
create user db_name#localhost identified by 'db_name';
grant select on <user_name>.* to db_name#localhost;
Never mind :) I found the solution although did not find what the problem was only suspecting that the root was not having any schema privileges ( as shown by MySQL Workbench GUI).
Earlier I was using command line with which I am not well versed; after struggling a little I downloaded MySQL workbench and added one more user with all administrative and schema privileges and used that to connect with Database connector and God Damn!! it's working.

Is “HANA database master” user the SYSTEM user?

I installed HANA Express in a VMware Workstation environment, and also Eclipse 4.6 with the HANA administrator plugin. Both VMWare and Eclipse run on Windows 10. I can start HANA with no issues, however when I try to connect from the Eclipse plugin the connection fails.
The tutorial to configure the HANA administrator plugin in Eclipse instructs to enter SYSTEM as user and then a password. The problem is that in the HANA Express tutorial the only user that seems to be set up is the "database master" (see text below). Therefore, I don't have the SYSTEM password and I don't know the "database master" user (even though I know the password). How to make this work?
Step 3: Startup: Configuration Script
A configuration script will run if this is the first login. When prompted
for HANA database master password, enter a strong password.
Tip: Make a note of this password, since you’ll need it later. You can enter
the same password you used earlier, or a new password. If you are entering a
new password, see the password rules earlier in this tutorial.
XSA_ADMIN
XSA_DEV
XSA_SHINE
TEL_ADMIN
When prompted to Confirm “HANA database master password”, enter the strong
password again.
This is the error I get in Eclipse log:
The SYSTEM password is the same as the master database password for HXE. If that does not work, try HXEHana1
Also, I see you are trying to connect to instance number 00. If the HXE VM is 2.0 sps00 or higher, the default instance number is 90.
You can rule out connectivity problems by running the following from the Virtual Machine's console:
hdbsql -n localhost -i 90 -d SYSTEMDB -u SYSTEM
This will connect to your instance and prompt for the password for user SYSTEM so you can confirm which one is right before configuring HANA Studio.
I had the same issue.
I used user : XSA_ADMIN and the HANA password chosen as part of the tutorial.
Its now connected.
Regards

[Couchbase-server]Adding user/Changing password?

I am a newbie getting started with couchbase-server.
I simply want to browse the data present in a couchbase server using UI at http://www.dataoncouchbase.com:8091/index.html.
The password for the account "Administrator" is unknown. But I need to login to see the data.
One technique for changing the administrator password on couchbase-server is the following command (I do have access to the machine via command line)
$$ /opt/couchbase/bin/couchbase-cli cluster-init -u Administrator -p old_password -c 127.0.0.1:8091 --cluster-init-username=Administrator --cluster-init-password=new_password
BUT...only works if you know the old password(which I don't have).
I also tried modifying the local.ini file present at : /opt/couchbase/etc/couchdb/ and restarting the server. I added a new line(username=password) under [admins] section in the file. However I am not able to log in with the new user as well.
It would be great if someone can give me a way to add a new user(with read/write permissions) or change password for Administrator OR point me to some resource to do the same.
cbreset_password - it'll reset Administrator password w/o need to know the prior.
Have you looked in "config.dat" according to this it may appear there in plain text. (granted, they are talking about web console).
It seems like you may have already seen this but I'll reference it just in case. The format they use for password stored in local.ini includes spaces -> "username = password" Also they recommend running the command 'ls -alR /opt/couchbase-server/etc' to help figure out where your problem might be. Perhaps you can post your output for that command here if the last two suggestions don't work out.
I had the same problem. Seems like there's no way to reset the password, but it is visible in the config.dat file. The other thing that caught me out is the username...it's case sensitive, so Admin != admin !!!
If you know the old password ( I know this is not your case, but I want to write the solution to help someone who knows old password), you should read:
I changed with this command ( although it has thrown error --> ERROR: option cluster-init-ramsize is not specified);
./couchbase-cli cluster-init -c 127.0.0.1:8091 --user=admin --password=OLDPASS --cluster-init-username=admin --cluster-init-password=NEWPASS
My configuration is;
CentOs Gnu/Linux &
Couchbase 2.5.0
I have run command under the directory: /opt/couchbase/bin
Ok man I figured it out :)
I use OSX but I guess the way will be simular.
I went into the CouchbaseServer.app in orde to view the content.
then you open the folder Content/Resources/couchbase-core/bin
and theres programm called cbreset_password :)
Then it asked you to change the admin password.....there you go.
I feel with you it took me 2 hours :)
Using couchsync with couchbase you can change all users password using the administrative REST API.
curl -vX PUT http://127.0.0.1:4985/yourdbname/_user/youruser --data "{"name":"youruser", "password":"newpassword", "admin_channels":["yourlistofchannels"], "admin_roles":["yourlistofroles"]}"
Using your command go to your Couchbase bin folder. For mac, this is
/Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin
In that folder, execute this:
./couchbase-cli reset-admin-password --new-password test123.
Your new password will be changed to test123.
Here is the detailed guide: https://docs.couchbase.com/server/4.6/cli/cbcli/reset-admin-password.html
Step1:
/opt/couchbase/bin/couchbase-cli reset-admin-password --new-password 'Pass#2020'
-------
SUCCESS
-------
You may be trying to login with username "Administrator" but you will see error sometimes. Because in some clusters "Administrator" may not be the default hard coded admin, to see the admin name see the below file (as follows):
$ ls -lrth /opt/couchbase/var/lib/couchbase/isasl.pw
$ cp /opt/couchbase/var/lib/couchbase/isasl.pw /tmp
$ cat /tmp/isasl.pw
{
"users": [
{
"n": "**Admin**",
------------------here "Admin" is the Administrator account. So use "Admin" as username to login with your new password changed in step1.

Openfire database settings issue in mac

I have Openfire 3.7.1 installed on my Mac and have XAMPP installed aswell. I am having trouble configuring OpenFire. In the server settings I have given san-imac.local.lan as the domain name. The selected Standard database connection and picked MySql Database Driver. This is the databse URL jdbc:mysql://localhost:3306/test and given the username password of XAMPP phpmyadmin. But it says
A connection to the database could not be made. View the error message by opening the "/logs/error.log" log file, then go back to fix the problem.
First of all there is no such file in the /logs folder. What should I do to get this working and follow the procedures to get OpenFire up and running.
I need to build an app to connect to openfire for IM chatting like Gmail, Facebook, Yahoo using XMPP. If anybody could provide any guidance aswell, it will be very helpful.
Make Sure that your database is setup correctly including the name of your database, database username, and user's password. If you have this correctly configured then your opens ire should work just fine. Note that it will not accept if the database username has an empty password or not enough access rights to the database.
I hope that those hints will solve your problem.
check your password and username, I had the same error and it took me a while to figure out that I had my username wrong.
Resolved the issue.
log file is not getting created due to file write permission. To resolve this run OF server as follows
Run the openfire.sh file from terminal with sudo. This will start the OF with root access Now the error log file will be created.
My log file has error message as access denied to user #localhost. As I kept the user field blank in db connection page of openfire set up.
Keep the user field as root#localhost if u are using localhost.

DB Access denied

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'admin'#'localhost' (using password: YES) in C:\wamp\www\connect.php on line 6
I've looked for a solution but haven't been able to find one.
The part on line 6 is
mysql_connect($server,$username,$password)
If it has to do with the problem, I'm using WampServer 2.1
Users admin#% and admin#localhost can have different passwords in MySQL. Try without a password.
Check the contents of the mysql.user table to see if your have multiple user records for admin.
This is a nice access model which allows different access depending on server the user is connecting from.
username/password combination should be incorrect.
You must have been prompted to set the password while installing WAMP Server.
You sure you are using the same password?
You can reset the root password by executing the following statement int the command line:-
mysqladmin -u root password NEWPASSWORD
If it complains mysqladmin is not a recognized command, then navigate to <WAMP-FOLDER>/mysql/bin folder before executing that statement.