I have a Yahoo website that uses phpMyAdmin. I've been given the directive "Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!" I do not know how to run this script (or any script) through phpMyAdmin. I've been looking online and one bit of advice was to click the SQL query window icon and type the following:

mysql mysql -u username -p password < mysql_fix_privilege_tables.sql

where username is my user name and password is my password. mysql is listed twice intentionally here because both the command and the name of the database is mysql, or at least that's what the online advice said. I get the "You have an error in your SQL syntax..." error. Does anyone know how to do this and what I did wrong?

Thanks.

Dani AI

Generated

Short version: the line tried is a shell command, not SQL. phpMyAdmin only executes SQL statements; it cannot run client-side redirection like "< file.sql" or OS commands. To run a script in phpMyAdmin you must upload the .sql file via the Import tab (or paste its SQL text into the SQL tab). See phpMyAdmin’s Import docs for the exact steps. (docs.phpmyadmin.net)

If you are on shared hosting (e.g., Yahoo) the warning about "privilege table structure seems to be older" means the server’s mysql.* system tables need updating. Two paths exist:

  • If your phpMyAdmin account can see a database named "mysql", select it, then use Import to run the file mysql_fix_privilege_tables.sql. If you cannot see or write to the mysql schema, the host must do this for you. (docs.phpmyadmin.net)

Quick check you can run in phpMyAdmin’s SQL tab:

SHOW DATABASES LIKE 'mysql';

For and : do not invent the file from a snippet. The script ships with MySQL. On Unix there was a helper named mysql_fix_privilege_tables; on Windows the SQL file lives under the MySQL installation (older versions used the scripts directory; later versions used share/). Hosts typically have this file; ask support if you do not. After it runs, MySQL usually must be restarted, which only the host can do on shared plans. (docs.oracle.com)

Note for future readers: mysql_fix_privilege_tables is legacy; modern MySQL uses mysql_upgrade (and in MySQL 8.0.16+ the server performs upgrades automatically on startup). If your provider has moved you to a newer MySQL, ask them to run mysql_upgrade or confirm automatic upgrade completed. (dev.mysql.com)

’s Import tip is the right approach; ’s "Repair database" tool generally does not update the mysql system tables, so it will not clear this warning. (dev.mysql.com)

Recommended Answers

All 14 Replies

I think your command is in wrong order. Following works for me

mysql -u username  DB_NAME < mysql_fix_privilege_tables.sql -p

Once I execute command I'm asked for password which I type in and job is done.

I think your command is in wrong order. Following works for me

mysql -u username  DB_NAME < mysql_fix_privilege_tables.sql -p

Once I execute command I'm asked for password which I type in and job is done.

Did you do this through phpMyAdmin or at a command line? I can do it at a command line on my home machine, but I can't get a command line on the web server at Yahoo. I'm stuck going through phpMyAdmin on Yahoo. At the command line on my home machine, it treats that first "mysql" as "find mysql.exe and execute it". Once you are in phpMyAdmin, I don't think it has the same meaning and I think you are no longer supposed to specify the program name (mysql), just like when you type "mysql" at the command line, once you get the "mysql" prompt, you don't type "mysql" anymore. If you were able to do it through phpMyAdmin, can you tell me where you typed that line please?

Yeah you right, only console. Stupid of me...
If you able to log in yahoos' phpMyAdmin there is somewhere option to import or create table out of existing sql file. I gone check on my hosting, give me few minutes...

Yes there is import option for text file that you can use for SQL file import. Please see attached image. Sometimes it may kick off with error message about different type of DB used but that can be solved by editing sql file.

commented: Helpful +5

Yes there is import option for text file that you can use for SQL file import. Please see attached image. Sometimes it may kick off with error message about different type of DB used but that can be solved by editing sql file.

That worked. Thank you!

May i know what file to import through the phpMyAdmin?

Can someone answer this one? I'm kind of in a jam. Do you copy the code snippet from above into a file named "mysql_fix_privilege_tables.sql" Any help would be great.

Can someone answer this one? I'm kind of in a jam. Do you copy the code snippet from above into a file named "mysql_fix_privilege_tables.sql" Any help would be great.

Can you please explain what your trying to do?

Can you please explain what your trying to do?

I've recently upgrading my phpAdmin on Yahoo Web Hosting and am getting a message on the bottom that says my PHP MySQL of 3.5 does not match my MySQL 4.1.14 which may cause unpredictable behavior.

With that said when I click on the privledges tab it says I need to run this mysql fix privledges table.sql to fix my tables.

I am a noob at mysql and am not sure how to run scripts I don't have access too. Sounds like the person above me had a similar situation.

Any ideas?

I'm having the same issue with my Yahoo hosting. When I click privileges in phpMyAdmin, I get the following error:

Warning: Your privilege table structure seems to be older than this MySQL version!
Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!

I have no idea how to run the so-called mysql_fix_privilege_tables script. Any help would be greatly appreciated.

Thanks!

i'm having the same issues T^T

can somebody tell me how to run mysql_fix_privilege_tables? where can i find the script?

In my windows system it's in e:\Program Files\MySQL\MySQL Server 5.1\share\mysql_fix_privilege_tables.sql and on my linux system in /usr/bin/mysql_fix_privilege_tables

Has anyone on Yahoo tried running the "Repair database" command in the Webhosting Control Panel > Create & Update > MySQL Database area?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.