Mysql Connecion to visual Basic - mysql

I am trying to setup the connection to a Mysql database. However I am getting a user error saying that:
WindowsApplication1.vshost.exe Error: 0 : Access denied for user 'Root'#'myiphere' (using password: YES)
A first chance exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
I have used this....
GRANT ALL PRIVILEGES ON permissionsex.* TO root#'%' IDENTIFIED BY 'password';
But the error is still there.

In your error message I can see you're using the username Root but you granted rights to root. Mind the lower-case versus upper-case r.

Related

Problems connecting to a MariaDB server: java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)

I am trying to connect a Spring Boot Application to my MariaDB server which is up and running. I am getting the following error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource
...
Caused by: liquibase.exception.DatabaseException: java.sql.SQLException: Access denied for user 'root'#'localhost' (using password: YES)
Now I've seen that similar questions have been asked on Stackoverflow before, and I tried the most common approaches, like granting all privileges:
GRANT ALL PRIVILEGES ON *.* TO 'root'#'localhost' IDENTIFIED BY '%password%' WITH GRANT OPTION;
And removing the password for the root user:
SET PASSWORD FOR root#localhost=PASSWORD('');
None of these approaches worked so far. I cannot really change the .properties file, but from what I can see a password is generated, encrypted and stored every time the application runs:
connection.driver_class = com.mysql.jdbc.Driver
connection.url = jdbc:mysql://127.0.0.1:3306/local02?useSSL=true
connection.username = root
connection.password = ../../config/local/dbkey.txt
connection.pool_size = 200
It's important to highlight that I am experiencing this problem just on MacOS, on Windows (same files, same DB, same IDE) doesn't arise.
Is there anything else I can try?
As far as I know Spring does not allow to use the root user of mariaDB. You must create a new user and grant priviledges.

ERROR 1045 (28000): Access denied for user 'admin'#'localhost' (using password: YES)

I'm trying to log in to mysql via a bash script or to be more specific, I want to check if the passed parameters for the mysql user are thes of an admin user.
For this reason it has to be possible to log in to mysql via a one line command e.g.
mysql -u $dbadmin -p$dbadminpass
To test why I didn't work, I tried it myself on the command line an I'm getting this Error:
ERROR 1045 (28000): Access denied for user 'admin'#'localhost' (using password: YES)
I created the use on #localost and gave all privileges. All my reasarch had no reasults so far.
I checked for any typos
You can try this:
GRANT ALL PRIVILEGES ON *.* TO 'admin'#'%';
FLUSH PRIVILEGES;
or try to connect to 127.0.0.1 not to localhost
This is not a problem with MySQL installation or set-up.
Each account name consists of both a user and host name like 'user_name'#'host_name', even when the host name is not specified. From the MySQL Reference Manual: https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_usage
MySQL account names consist of a user name and a host name. This enables creation of accounts for users with the same name who can connect from different hosts.
This also allows MySQL to grant different levels of permissions depending on which host they use to connect.
When updating grants for an account where MySQL doesn't recognize the host portion, it will return an error code 1133 unless if it has a password to identify this account.
Also, MySQL will allow an account name to be specified only by it's user name, but in this case it is treated as 'user_name'#'%'.

MySQL - Error 1045 (28000) for user 'jim'#'localhost' (using password YES)

I'm new to mySQL so bear with me. I'm using Windows 10, EasyPHP 13.1.
I've been reading up on MySQL, and I'm currently at the point were I'm creating a user.
I used the following code, to grant permission to the jim user
GRANT ALL ON publications.* TO 'jim' IDENTIFIED BY 'mypasswd'
I exited out of MySQL and attempted to log in again with the password above.
I keep getting the following error message
"Error 1045 (28000) for user 'jim'#'localhost' (using password YES)"
I did some research concerning the problem and ran into this:
MySQL ERROR 1045 (28000): Access denied for user 'bill'#'localhost' (using password: YES)
I had trouble with this, so I'm not exactly sure what an anonymous user is? The responder recommends to drop the anonymous user but how does one go about doing that? I was skeptical of the other answers as they were recommending practices that are considered dangerous (Judging from the comments).
How does one go about solving this problem.
You did not specify host information for you login.
Try below for connecting only from localhost.
GRANT ALL ON publications.* TO 'jim'#'localhost' IDENTIFIED BY 'mypasswd';
Or below for connecting from everywhere.
GRANT ALL ON publications.* TO 'jim'#'%' IDENTIFIED BY 'mypasswd'
You are probably reading the chapter 8, edition 2-3 of the book of Robin Nixon "Create dynamic websites by using: PHP, MySQL, JavaScript, CSS and HTML5".
I would advise you to find/buy English version. In the new 4th edition, the author has fixed this issue:
GRANT ALL ON publications.* TO 'jim'#'localhost' IDENTIFIED BY 'mypasswd';
But it's sort of bad practices since new user should be not "auto-created" with the GRANT command. For this you have another command:
CREATE USER 'jeffrey'#'localhost' IDENTIFIED BY 'mypass';

Warning: mysql_connect(): Access denied for user

How do I make the MySQL give the user access and not deny?
how do i add the command too add permissions?
This is the full error
Warning: mysql_connect(): Access denied for user
Database error: Link-ID == false, connect failed
MySQL Error: 0 ()
Session halted.
Have you allowed access to the MySQL server for the login/server combination you provide?
grant all permissions on *.* 'bf_cards_user'#'My Server IP'
identified by 'bbeqvfyAwPWECvWs';
flush privileges;
or
Either your username, password or database name is wrong.
The error message is deliberately vague in order that unauthorised system-crackers are not helped to find out what they need to change; although I guess you know your username and password.
Refer here http://www.simfatic.com/forms/troubleshoot/mysql-connect-failed.html

MySQL connection with DBVisualizer

I've created a user (1caap) in mysql root account and given read only privileges for this user to one of my database. Now my client(1caapuser) is unable to access this database. I've established the connection using Workbench. He's getting the following error when he's trying to access this database using DBVisualizer:
An error occurred while establishing the connection:
Type: java.sql.SQLException Error Code: 1045 SQL State: 28000
Message:
Access denied for user '1caapuser'#'x.x.x.x' (using password: YES)
Please help me out if i'd missed any settings at the earliest.
To resolve this issue you have to grant all privileges on database with identified by the password
Command to run:
GRANT ALL PRIVILEGES ON yourDBname.* TO username#'%' IDENTIFIED BY 'password';
Check the following for more details about the error you get:
http://dev.mysql.com/doc/refman/5.1/en/access-denied.html
https://dev.mysql.com/doc/refman/8.0/en/error-access-denied.html
You must most likely grant proper access for the user at the given IP address/host name. Such as:
grant on . to ''#'';
Check the users guide which specific privileges and what target objects to grant. The important clause above is that you need to specify 'user'#'ip-address'.
Again, check the users guide as there may be a collection of reasons for the error you get.