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
Related
I am trying to run the following command in MySQL as the root user:
set global log_bin_trust_function_creators=1;
However, this gives me the following error:
Access denied; you need (at least one of) the SUPER privilege(s) for this operation
To overcome this, I tried to grant the SUPER privilege to the root user by running:
GRANT SUPER ON *.* TO 'root'#'my-host' IDENTIFIED BY 'my-password';
This in turn gives me the error:
Access denied for user 'root'#'%' (using password: YES).
So I am not really sure what to do. The MySQL version is 5.7.36 and I am connecting to the database remotely. The root user is also set to mysql_native_password as well. Any ideas on what I can do?
This database was part of Google Cloud SQL and with managed databases like this and Amazon RDS, SUPER privileges are not supported. To enable this parameter, you need to set it through the Google Cloud SQL flags or in case of Amazon RDS, the parameter group.
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
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. :)
I have a online server with phpmyadmin. i want to use events, but i can't.
Ok, I had the same problem and I just fixed it. Try granting root permissions explicitly for the database you are using.
GRANT ALL PRIVILEGES ON ${database}.* TO 'root'#'localhost' IDENTIFIED BY '${pass}';
I want to create a new mysql user and database demo in my company. Here is the commands i input in the mysql.exe :
create user 'admin'#'localhost' identified by 'admin';
create database dem;
Everytime i have that response:
access denied for user ''#'localhost' to database.
Actually i refered to that similar question :
MySQL - Access denied for user
Can anyone help please ???
I would suggest creating the database first then you can create a user, and use the GRANT option to allow permissions to that user for whatever you find necessary. However, creating a user first then a database while it's able to "potentially" work, isn't the best practice with MySQL. So you want to effectively do the Steps as such:
Create Database
Create User
GRANT permissions
???
Profit
You have to GRANT access to admin for dem.
GRANT ALL PRIVILEGES ON *.* TO 'admin'#'%' WITH GRANT OPTION;
You may have to also GRANT the same for admin#localhost as well. IIRC if you ever logon remotely with admin you would inherit the base privileges unless otherwise GRANTed
You can find many answers HERE.