xampp mysql: select command denied - php

I am using xampp om windows 7. I logged in as the root user with the password i have set up. I created a new database(I am using xampp for the first time). and I am not getting any option for creating any tables in it.
It shows the following error:
Error
SQL query: DocumentationEdit
SELECT `tables`
FROM `phpmyadmin`.`pma_recent`
WHERE `username` = 'root'
MySQL said: Documentation
#1142 - SELECT command denied to user ''#'localhost' for table 'pma_recent'
How do I get rid of this?
I get this line also, somewhere at the bottom of the page along with the error message:
The phpMyAdmin configuration storage is not completely configured, some extended features have been deactivated.

http://dev.mysql.com/doc/refman/5.1/en/grant.html
GRANT SELECT ON db.table TO 'user'#'localhost';
GRANT ALL ON db1.* TO 'jeffrey'#'localhost'; ------------ i think this is much better.

Related

"Syntax error or access violation: 1142" in Symfony and MySQL

I am creating an API REST aplication with Symfony3, and I have this problem. When I execute the methods in localhost it works fine, but I have uploaded the project to a server administered with Plesk, and when I try to execute the methods with postman, it shows this:
An exception occurred while executing 'SELECT t0.random_id AS ...'
with params [\"a\", \"a\"]:\n\nSQLSTATE[42000]: Syntax error or access
violation: 1142 SELECT command denied to user 'app'#'localhost' for
table 'table_name'
It seems to be a permissions problem, but if I try to access to the database with MysQL Workbech, with the same credentials, I can do it and execute querys without problems. And in the Plesk panel, the user has all the permissions and privileges.
I have also tried changing "localhost" for the host address in the parameters file of Symfony.
Looks like app user doesn't have permissions to execute SELECT query.
Run following MySQL query to fix it:
GRANT SELECT on database_name.* to 'app'#'localhost' identified by 'your-pass';
FLUSH PRIVILEGES;

MySQLi query getting permission denied [duplicate]

I am running into a permission error when trying to load data from a flat file database dump into a new table. I know that the schema of the file and my table is the same and I tried tweaking the permissions. What else should I try?
mysql> load data infile 'myfile.txt' into table mytable fields terminated by ',' enclosed by '"';
ERROR 1045 (28000): Access denied for user 'user'#'%'
grant all on mytable.* to 'user'#'%
Here's a thread on the MySQL forums that discusses exactly this.
Here's the answer, posted by Ken Tassell
Problem resolved using the command below:
grant file on *.* to kentest#localhost identified by 'kentest1';
You might have MySQL privileges on the destination table, but you also need the FILE privilege to execute LOAD DATA, and of course the MySQL Server process needs operating-system privileges to the data file too.

Mysql connection works exept for SELECT * INTO OUTFILE statment

My website works fine except when I execute back-up function for mysql it throws this error :
SQLSTATE[28000]: Invalid authorization specification: 1045 Access denied for user 'username'#'localhost' (using password: YES) (SQL: SELECT * INTO OUTFILE '/archive/db-backup-date-09-09-2015-time-10-30-04/accounts.csv' FROM accounts)
i tried this statment :
GRANT FILE ON \*.\* TO 'username'#'localhost'
but it throws another error
#1045 - Access denied for user 'myHostingUserName'#'localhost' (using password: YES)
note that in this error it the user for who access is denied is my hosting user name (hostgator), but I don't have MySql user with this name
Actually mysql does not rights outside so you need to export your file within mysql, you can use as per below-
SELECT * INTO OUTFILE '/tmp/accounts.csv' FROM accounts;
assuming /tmp is a directory where mysql is creating temp files.
Also aussing that your csv creation command is fine for you as you are not managing fields seperation etc. issues in it.
Regarding 2nd error, you don't have permission to grand rights.

SELECT command denied to user ''#'localhost'?

I am using XAMPP and phpmyadmin to make a site on the localhost. I keep getting the message:
SELECT command denied to user ''#'localhost' for table 'players'
All privileges ARE granted to the user. When I hover over the user in phpmyadmin, it says 'includes all privileges except grant'.
What do I do? I am relatively new to this.

MySQLi - Can't find the user

I'm trying to create a connection to my MySQL database through MySQLi by using the following code:
$con = mysqli_connect( "localhost", "wesley", "", "project_tim" );
Now, my error (well, warning) is the following:
Warning: mysqli::mysqli(): (HY000/1044): Access denied for user ''#'localhost' to database 'project_tim'
As you can see, there is no user in the error line. What can the problem be? I have the latest version of Xampp, the user is created and both services are running.
Finally the problem is wesley user don't have the permission to access the database.
To provide permission for wesley user, run this command in your MYSQL console or in phpMyAdmin
GRANT ALL ON project_tim.* TO 'wesley'#'localhost';
And restart your xampp

Categories