I am facing problem in setting mysql replication monitoring using mk-heartbeat.
DBI connect('Heartbeat;host=10.160.251.223;mysql_read_default_group=client','heartbeat',...) failed: Access denied for user 'heartbeat'#'%' to database 'Heartbeat' at /EBSroot/maatkit/mk-heartbeat line 2056
I have created a user heartbeat that has no permissions.
Please refer this document http://www.maatkit.org/doc/mk-heartbeat.html
Also Access denied error is because of invalid credentials. Check MySQL username and password are correct on both server (Master and slave) and run application by referring to documentation provided.
I suggest you use mysql shell command to check if the username or password is ok
for example :
mysql -u heartbeat -p -h 10.160.251.223, and just enter if you don't have password...
by the way, I suggest adding a password for this user for security.
Related
I'm setting up a MySQL database following this tutorial. I installed it and successfully initialized an instance with a root password, but I am having trouble connecting to the instance via command line. When I click on the 'mysql' executable under bin, I get this message
ERROR 1045 (28000): Access denied for user 'hunter'#'localhost' (using password: NO)
and if I try to enter
> mysql -u root -p
in the terminal I get this message
-bash: mysql: Permission denied
It says in the instructions that I should be getting prompted to enter the password for the database, but for some reason it won't let me.
I would suggest first off to try a mysql workbench. You can download it at https://dev.mysql.com/downloads/workbench/ .
It seems that calling mysql from bash is causing issues for you. If you are using a *Nix environment, it could be a permissions issue and you need to set the correct permissions on the mysql binary. However, usually a correct installation should have already done that. See: https://askubuntu.com/questions/229589/how-to-make-a-file-e-g-a-sh-script-executable-so-it-can-be-run-from-a-termi
Secondly, you should use the username root . hunter is not default username.
From the mysql documentation:
How to Reset the Root Password
If you have never assigned a root password for MySQL, the server does not require a password at all for connecting as root. However, this is insecure. For instructions on assigning a password, see Section 2.10.4, “Securing the Initial MySQL Account”.
Reference:
https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html
I tried to change password in my database but after i changed it right away, I got an error saying
mysqli_real_connect(): (HY000/1045): Access denied for user
'root'#'localhost' (using password: NO)
and
phpMyAdmin tried to connect to the MySQL server, and the server
rejected the connection. You should check the host, username and
password in your configuration and make sure that they correspond to
the information given by the administrator of the MySQL server.
How to fix this? Do i need to configure something about the connection and where can I fix it?
Do you able to connect mysql in command line.
#mysql -u root -p
then provide the password to access mysql command line.
if Yes, then please make sure that you given the correct information while installing the phpmyadmin.
I'm trying to use the mysqldbcompare tool but getting a connection error:
$ mysqldbcompare --server1=client --skip-data-check db1:db2
# server1 on <ip>: ...
ERROR: Access denied for user 'root'#'<ip>' (using password: YES)
I can use mysql and connect just fine, though. I setup my creds using mysql_config_editor --host=<ip> --user=root --port=3306 --password and tested with the mysql command with and without passing all the args (mysql -u root -p -h <ip> -P 3306).
I've checked the bind address of the server and looked in the server error logs but it just reiterates a connection refused message. I've searched online (and on SO) but haven't been able to find anything.
Any help is appreciated.
When you encountered an access denied error it means the TCP connection has been established, but the password you provided is wrong for'User'#'Host'(a User-Host pair is a real account for MySQL authentication, not a single username).
Assume that MySQL server runs on 172.0.0.8 and your local address is 172.0.0.5.
Take a look at mysql.user by: SELECT * FROM mysql.user\G;. If you can't find either of these two User-Host pairs: 'root'#'172.0.0.5' and 'root'#'%', it means there is no such account. So you failed.
Also check the password of the existed User-Host pair from the output above.
Now, the connection is fine, the account exists, the password is right, the only chance for such an error is: mysqldbcompare didn't use the arguments you provided!
Try other workaround like: mysqldbcompare --server1=root:password#172.0.0.8:3306 --skip-data-check db1:db2
Check all these stuff step by step, and you will figure it out.
I think this command of mysql compare don´t use the default config, try to force the user and password into the command line.
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.
I have taken the the following steps to transfer my sql database but yet I receive an error on the importing of the database onto the new server. It does not seem to recognize my username or password.
I think the problem is being caused by phpMyAdmin privilege settings. I am transferring my sql file from a server that runs phpMyAdmin (hostgator) to an unmanaged web server.
Here are the steps I took
mysqldump -u root_wrdp1 -p --opt root_wrdp1 > root_wrdp1.sql
Enter password:
I then scp'd the sql file to my new web server (that does not run phpMyAdmin).
scp rbl91_wrdp1.sql root#ip.of.the.server:~/
Then I did the updating of the database on the web server without phpmyadmin...
root#www:~# mysql -u root_wrdp1 -p root_wrdp1 < ~/root_wrdp1.sql
Enter password:
ERROR 1045 (28000): Access denied for user 'root_wprd1'#'localhost' (using password: YES)
The support by the site offered this advice but I have no idea how to implement the steps.
It's possible you have to review the authorization locations, such as the source location (IP) of the remote side.
Using phpMyAdmin i believe the page is Priviliages , and you will also
need to flush them after changing.
Thanks Support
It's a simple authentication problem. Most likely the "root_wrp1" account or password are set up incorrectly on the destination machine. You can check it just by trying to log in without importing the dump file:
$ mysql -u root_wrdp1 -p root_wrdp1
The account and password need to be set up and have adequate permissions to the database before you can restore the dump file.