xampp Creating Databases Error 1044 (42000) - mysql

I tried to create a database using MySQL. I encountered this problem. How can I fix it?
ERROR 1044 (42000): Access denied for user ''#'localhost' to database
'sample_db'

You should check user privileges, there are users take privileges on specific database only, and others are super users who take all privileges and through this users you can create database.
You can see that through phpMyAdmin application and can access it by:
Http:\localhost\phpMyAdmin

Related

Mysql Mariadb user not able to access DB

I created a schema and granted its permission to a specific user:
GRANT ALL PRIVILEGES ON USED_CARS.* TO ANDREW#LOCALHOST;
The database is created with root user and then granted these permissions to another user. now when I swith to another account I can list the schema with SHOW SCHEMAS; query however cannot switch to that DB with use USED_CARS; query.
Following error pops up:
ERROR 1044 (42000): Access denied for user 'ANDREW'#'localhost' to database 'USED_CARS'
What am I missing here? Thanks for the help in advance.
Sometimes depending on the configuration of server, you can use localhost or the ip:127.0.0.1
Could you try with this ...
GRANT ALL PRIVILEGES ON USED_CARS.* TO 'ANDREW'#'%';

why the following errors occurs in creation of databases?

I tried to create databases but the following error occurs?
mysql> create database sample;
ERROR 1044 (42000): Access denied for user 'db_cad'#'%' to database 'sample'
your user "db_cad" don't have rights to create table after connecting to from another machine on sample database.
using following commands you can check your rights.
show grants;

mysql: access denied on information_schema

When i'm create new user or grant privileges to existing, i got this error:
ERROR 1045 (28000): Access denied for user 'root'#'localhost' (using password: YES)
Grant privileges ok on all tables, except information_schema, on this table i got access denied error.
How i can fix? Dump all databases, drop all databases, and then restore from dump?
The MySQL documentation says:
... you can only read the contents of tables, not perform INSERT, UPDATE, or DELETE operations on them.
It is not necessary to grant access to these tables. All users already have access.
"Each MySQL user has the right to access these tables, but can see only the rows in the tables that correspond to objects for which the user has the proper access privileges. In some cases (for example, the ROUTINE_DEFINITION column in the INFORMATION_SCHEMA.ROUTINES table), users who have insufficient privileges will see NULL."
https://bugs.mysql.com/bug.php?id=45430
http://dev.mysql.com/doc/refman/5.1/en/information-schema.html
Note that if you have a typo in the name information_schema, you would also get an denied to user message. This is confusing sometimes.
select * from bogusSchema.bogusTable;
The error would be
Error Code: 1142. SELECT command denied to user 'user123'#'localhost' for table 'bogusTable'
I am using an InfoBright variant of MySQL. Not sure if this same problem exists with other variants/versions of MySQL.

MySQL access denied for multiple users

I'm playing around with MySQL and Django and I'm having some trouble because I'm new to this.
I'm trying to run the command:
python manage.py sql login
to add login to my apps and I get the error:
OperationalError: (1044, "Access denied for user 'classdummy'#'localhost' to database 'classydummy'")
I tried looking for the database 'classdummy' and user 'classdummy'#'localhost' but I didnt see them so I tried to create both
I was successful in creating a database named 'classdummy' but when I try to create a user named 'classdummy'#'localhost' I get this error:
ERROR 1396 (HY000): Operation CREATE USER failed for 'classdummy'#'localhost'
I'm not sure if I'm doing all this correctly
Thank you for all the help!
if you can login to mysql as a privileged user, you can run a grant command:
grant all privileges on classdummy.* to 'classdummy'#'localhost' identified by 'mypassword123z';

Privileges issue

I have a mysql database (version 5.5), and I am trying to add a new user.
But I don't have the privileges to create it.If I try to show the list of all users:
select * from mysql.user;
It gives this error:
ERROR 1142 (42000): SELECT command denied to user ''#'localhost' for table 'user
It seems like I am not able to do anything.How to grant the privileges for a user without using the grant command?
There's a way? I also tried this:
CREATE USER 'ramy'#'localhost' IDENTIFIED BY 'pass';
It says:
ERROR 1227 (42000): Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
I don't see any way to handle privileges, mysql show have a method to handle privileges for who have newly created a database.That's a vicious circle.
You need to login as the 'root' account
See this if you don't know the root password
http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html