I'm making a new project on heroku, using mysql (they have an addon called JawsDB, which gives me a mysql host, username, password). (Update: I've also tried using their other mysql addon, ClearDB, and I have the exact same issue)
I can connect to the database like so (and I can 'show databases' to see what's there):
mysql -h izm96dhhnwr2ieg0.cbetxkdyhwsb.us-east-1.rds.amazonaws.com -u knu81lzn5m79u3rx -p[given_password]
Problem: When I do create database nptest, I get:
Access denied for user 'knu81lzn5m79u3rx'#%' to database 'nptest'
I've tried granting all privileges, like this:
grant all privileges on *.* to 'knu81lzn5m79u3rx'#'%' identified by '[given_password]';
but that gives me:
Access denied for user 'knu81lzn5m79u3rx'#'%' (using password: YES)
I also tried create user to make a fresh one, but of course then it's "Access denied" because I don't have create user privileges either.
What's the correct way to grant access to this user?
Ah! The answer was that the preliminary plan on jawsDB gives you one specific database (that has a cryptic name) on a shared server with other people, so you don't have permissions to make a new one. It wasn't clear in the instructions, so now I'm humming away with good old database "tbkrv66g085ulngi" :)
To further clarify on Diane's answer, the cryptic database name can be found by logging into JawsDB via a mysql client and runningshow databases or it's the last parameter of the JAWSDB_URL that can be found running heroku config.
i think if you use it in production mode it will solve the probl
Related
I have created a database using MySQL version 8.0.22 (I realize it's not the newest version but the newer version didn't work on my laptop). I need to have somebody (for who I made the database for) have full access to the database from their own laptop. I created their user with a password, granted full access, and flushed privileges.
CREATE USER 'user'#'localhost' IDENTIFIED BY 'password1234!';
GRANT ALL PRIVILEGES ON fsk TO 'user'#'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
However, I still got the error:
"Access denied for user 'user#'localhost' (using password: YES)"
I have been googling this error for the past two days and have everything from making sure there aren't any duplicates that contain "%" instead of "localhost" to reinstalling the program. For even more clarification, when trying to connect on MySQL Workbench, I entered 'localhost' for the "Hostname" field (didn't use quotes around localhost), the correct username, and finally, the correct password (made sure after attempting plenty of times very slowly).
Am I missing something with trying to get this working? I really just need one user to have full access to the database from another laptop and I keep getting "Access Denied" when trying to log in as that user I have created.
Any help would be GREATLY appreciated.
I wanted to setup my owncloud installation on my raspberry pi 2. So, I created an mysql database and user.
CREATE DATABASE owncloud;
CREATE USER 'owncloud'#'localhost' IDENTIFIED BY 'Password';
GRANT ALL PRIVILEGES ON owncloud. * TO 'owncloud'#'localhost';
FLUSH PRIVILEGES;
After I type all nessesairy parameters into the webinterface of the owncloud-setup, I recevied:
Error while trying to create admin user: Failed to connect the database: An exeption occured in driver: SQLSTATE[HY000][1045] Access denied for user 'owncloud'#'localhost' (using password:YES)
Sadly, my resent sreach on similar topics didn't result in any functional hint on this problem. So, I would be happy about further suggestions.
Look at this: https://doc.owncloud.org/server/9.0/admin_manual/installation/installation_wizard.html#database-choice
In Terminal: mysql_upgrade --force -u root -p
Use administrative MySQL »root«-user and password with the Installation Wizard
Check that the Database not exist which you create with the Installation Wizard
If nothing helps, start with sqlite, then migrate to mysql like this: https://doc.owncloud.org/server/9.0/admin_manual/configuration_database/db_conversion.html
Just replace localhost for 127.0.0.1 in Owncloud's setup form for MySQL as mentioned in comments above by Askaga
For some reason, explicitly re-access the database from the terminal solves the problem for me. Just give mysql an empty line with
mysql -u root -e ";"
This should be an individual command after you created database and database user.
Sure, you should always check whether
There are users with an empty username. Remove them.
Remove "test" database.
Grant appropriate permission to your database user.
Last but not least FLUSH PRIVILEGES;.
Search other posts for instructions. I'm just providing a possible solution if you come across a situation where none of the above works.
Here's a good example to properly setup mysql after installation. FYI.
Mask the DB password in the installation screen (the password should not be visible, only dots) and retry.
Ubuntu 18.04.1, Owncloud 10.
Check the contents of config.php in my case located at /var/www/owncloud/config/.
Specialy items dbuser and dbpasswrd.
Read config.sample.php in the same directory for info.
I have to create a database in a Windows Server 2008 remote machine, which already had MySql Server 5.5 and MySql Workbench 5.2 installed. Since I wasn't granted the password to the root user, I tried to create a new user.
In MySql Workbench I tried to open the Manage Security option, to no avail, since it asked for the password.
In the command prompt I tried to run mysql but it returned the following error message.
ERROR 1045 (28000): Access denied for user 'ODBC'#'localhost' (using password: NO)
Is there any way to create a new user without having prior access to the root user?
More generally, is there any workaround to create and use a database without access to root?
You don't have to be the root user, but you must have rights to create a user. You can get those rights with the grant create user statement. Apparently, you don't have those privileges, so if you need them, you should ask your administrator.
So the answer is: There is no workaround. You don't have to be root, but you must have certain privileges.
In practice, if you need an extra user, the administrator is more likely to create one for you than to give you the rights to create them yourself. But that's something he and you need to figure out yourselves. :)
A friend of mine asked me to help him with some minor php/mysql job. He gave me his cpanel access and I have to create a database for him.
I get the error:
MySQL issue : Access denied for user 'user'#'localhost' (using password: YES)
When I type in phpMyAdmin:
CREATE DATABASE db_name;
Is there a way I can grant all priviledges to the user he provided, or is there a way I can create a database with other user?
You can grant usage by using
grant usage on *.* to prasad#localhost identified by 'passwd';
Another thing regarding access denied to even localhost is caused when your firewall is active. You can try disabling antivirus software and also firewall.
A suggestion will be if you are using mysql, then mysql workbench is a great to have. You can create databases through GUI quite easily
I've stablished an user that will be used for reporting in my Database. I've granted just SELECT privileges over the necessary database.
I'm able to log into MySQL from phpMyAdmin for example and I do with the user what is supposed to do.
However, the following error arises once you try to read from an ODBC:
[MySQL][ODBC 3.51 Driver]Access denied for user user#server_ip (using password: YES)
Do I need to do something extra? The access with root doesn't have this problems but, obviously, I don't want to grant all permissions to that user for security reasons.
You must first make sure that the user has your desired access when it connects locally. You can test this using the MySQL Query Browser or MySQL Command Line client.
Now, if there is no issue when tested locally, and if the root user is able to access the tables from the remote machine, then something must be wrong with the user's permissions which prevents it from accessing the tables from the remote host. Check if you have correctly granted the needed permissions to the user. Here is the correct syntax:
mysql> CREATE USER 'custom'#'host47.example.com' IDENTIFIED BY 'obscure';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
-> ON expenses.*
-> TO 'custom'#'host47.example.com';
See Adding User Accounts in MySQL Reference Manual.