mysql is not reading the .mylogin.cfg file correctly - mysql

I have created the .mylogin.cfg file with below commands and then tried to connect to mysql with the --login-path option but unable to connect to it. any suggestion are really useful.
mysql_config_editor set --login-path=test --host=10.219.39.121 --user=vidya --password
mysql_config_editor print --all
[test]
user = vidya
password = *****
host = 10.219.39.121
while connecting it is showing error on different IP address as shown below
mysql --login-path=test
ERROR 1045 (28000): Access denied for user 'vidya'#'10.219.39.122' (using password: YES)
Here my concern is why it is showing different IP address and why it is not able to connect even the password is correct. I am using mysql 5.6.6-m9-alpha60.1-log Percona Server.

Related

Accessing Database with python or command line

I am able to access and query the database on the web interface of PhPMyAdmin using a user credentials. However, when I am trying the following command line commands:
mysql -h (<url of phpmyadmin>) -u (<non-root username>) -p (<database>)
Or this error:
ERROR 2059 (HY000): Plugin http could not be loaded:
dlopen(/opt/homebrew/Cellar/mariadb/10.8.3_1/lib/plugin/http.so,
0x0002): tried:
'/opt/homebrew/Cellar/mariadb/10.8.3_1/lib/plugin/http.so' (no such
file)
I have also tried replacing host with "localhost" and I get this issue:
ERROR 1045 (28000): Access denied for user 'data_analyst'#'localhost'
(using password: YES)
I am not sure how I can connect to get data from the database even though when I connect directly to the webpage I get access to it but when I try the same on command line I am unable to.
With mysql -h it takes a hostname as an argument, not a url. As using localhost as the hostname generates access denied, its making a connection so -h isn't needed as an option (localhost is the default`).
There needs to be a space between -p and the database name. Check the non-root user authentication password.

Cannot connect to mysql datavbase ERROR Access denied for user... (using password: YES)

Running a php script or trying to connect via terminal (locally) I get the same error
Access denied for user... (using password: YES)
mysql -u username -p'password' -h ip db_name
It passes to the server but get's blocked because of password although correct value was provided.
I've tried several fixes associated to this scenario but to no avail.
When a tried to execute some queries which could provide extra info for the fix, I get
1142 - SELECT command denied to user ... for table 'user'
I've assigned username, password and all privileges in cPanel MySql databases section (for the database) but am unable to connect using the created user as if a root user is blocking access to the database.
Am on GoDaddy host.
These are the only actions that I can preform on my database

I can't connect to MySQL server in any way (on Windows)

My problem is below:
C:\Users\ordek> mysql
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: NO)
C:\Users\ordek>mysql -u root -p
Enter password: ****
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using
password: YES)
I tried lots of solutions before asking here. I've even tried reinstalling MySQL but surprisingly this problem still exists. In Workbench I can't connect to any connection. I always login to the MySQL server as superuser and subsequent attempts to change privileges didn't work because I can't log into MySQL in the usual ways.
In Workbench it doesn't matter which user: root or not, you'll get this message.
[Window Title]
MySQL Workbench
[Main Instruction]
Cannot Connect to Database Server
[Content]
Your connection attempt failed for user 'user1' to the MySQL server at
127.0.0.1:3306:
Access denied for user 'user1'#'localhost' (using password: YES)
Please:
1 Check that MySQL is running on address 127.0.0.1
2 Check that MySQL is reachable on port 3306 (note: 3306 is the default,
but this can be changed)
3 Check the user user1 has rights to connect to 127.0.0.1 from your
address (MySQL rights define what clients can connect to the server and
from which machines)
4 Make sure you are both providing a password if needed and using the
correct password for 127.0.0.1 connecting from the host address you're
connecting from
In "test connection"(WORKBENCH) I always get this message:
[Window Title]
MySQL Workbench
[Main Instruction]
Failed to Connect to MySQL at 127.0.0.1:3306 with user user1
[Content]
Access denied for user 'user1'#'localhost' (using password: YES)
In my mind this is a problem with privileges, but I don't know what to do because I'm a beginner at MySQL. If you know how to overcome this problem, please let me know.
I believe you installed MySQL (windows) using .msi package. As it .msi allows you to do the installation step by step and you can set "root" password.
If you have root password, make sure MySQL services are started.
Control panel > services > Mysql
The user ordek seems unknown to mysql . Switch to root user and it will work .
If this is not possible , or the root password is unknown , re-install mysql , make a note of the root password for future use , create the ordek user and assign it the access rights it needs .

MySQL console: change user host in conncetion string

I'm trying to connect to the MySQL database using MySQL console.
MySQL has user: test#% without password.
When i'm trying to connect:
mysql -u test -h 127.0.0.1
I got error:
ERROR 1045 (28000): Access denied for user 'test'#'localhost' (using password: NO)
How i can change user 'test'#'localhost' to 'test#%'?
MySQL has a bit strange logic about the placeholder host, i.e. permissions for the host %. (I'm not sure if "placeholder host" is the correct official name for this.) Namely, the placeholder host does not capture localhost. This can be a bit counter-intuitive.
To be able to log in you will therefore either have to connect from a remote IP (i.e. another computer) or have to grant permissions to test#localhost.

Problems connecting to remote MySQL database

When I try to connect to a remote mysql database I receive an error saying I was unable to log into my router's mysql database.
tom#main:~$ mysql -u appleton -p -h 85.17.xxx.xx
Enter password:
ERROR 1045 (28000): Access denied for user 'appleton'#'85.210.169.xxx' (using password: NO)
Even though I am specifying my IP (85.17.xxx.xx) in the argv the error message is showing my Router's external IP (85.210.169.xxx)
I discovered this whilst using DBI->connect in perl.
Am I missing something obvious?
'appleton'#'85.210.169.xxx' is supposed to show your host, not the database's host. It's your full identifier (username#host) for mysql to determine if you are allowed to connect. Do you have sufficient rights to connect to the database from your IP? Access can be granted to users so that they can only connect from localhost for example.
MySQL Docs on Users