It could be your admin user is connecting from admin@127.0.0.1
.
Assuming admin is the actual user you have privileges on, try connecting through:
> mysql -h 127.0.0.1 -u admin -p
The way MySQL handles users, the host is very important, and in this case 127.0.0.1 is different than localhost.
If your phpMyAdmin user has access to the mysql database, you can the following statement to see what user/host combinations exist on your install.
SELECT User, Host FROM mysql.user
1) GUI option
You can use Toad for MySQL Freeware from here.
To take an export that creates inserts for a specified set of data, after creating a connection to your mysql database, you can choose Tools->Export->Export Wizard
Click Next, then Add Button
Choose query as the Export category and then type your SQL statement for one of the tables
SELECT col1, col2 ...
FROM table_name
WHERE tool_id='xyz'
Then Click next - choose SQL SCRIPT any other relevant options
Choose file as the output
Repeat this for as many tables as required
Then execute it to create a set of insert scripts.
You can take a structure export either using TOAD or phpmyadmin and the combination should give you what you are looking for which i assume is a cut down set of data for a test environment.
2) Command line option
Use mysqldump at the command line and list all tables that have the tool_id column
mysqldump -t -u [username] -p test mytable anothertable --where="tool_id = 1"
This should generate a set of insert statements and as above, if you load these scripts into an empty schema exported with phpmyadmin using structure only, it should give you what you need.
Best Answer
This is not a PHP error, but a MySQL error. Basically, as the error message says you're either not using the correct username, password or the user privileges haven't been flushed since you added the user. That is, I'm assuming that you've removed the username from the error message, and not trying to log in with an empty parameter.
You need to check that the selected user has access to the database in question, and that the privileges has been flushed. Using the MySQL CLI client you can do this by the following commands:
The latter should only be used after you've added, deleted or changed the permissions of any MySQL users in the above tables. If you don't have access, look at the MySQL manual for help on GRANT. Alternatively, search the web.