• 0

[PHP and MySQL] Flush Privileges


Question

Hi All,

I am new to PHP, but I think I have learnt quite a lot so far. :D I have a question regarding the MySQL query, flush privileges. Do I need to include it?

I have set up a PHP page that adds information to a MySQL database using the INSERT statement. The database contains user data.

If possible, could someone also tell me when it should be used?

Thanks,

Smctainsh

Link to comment
https://www.neowin.net/forum/topic/498793-php-and-mysql-flush-privileges/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

From MySQL manual:

  Quote

http://dev.mysql.com/doc/refman/5.0/en/adding-users.html:

...

The reason for using FLUSH PRIVILEGES when you create accounts with INSERT is to tell the server to re-read the grant tables. Otherwise, the changes go unnoticed until you restart the server.

With GRANT, FLUSH PRIVILEGES is unnecessary.

...

As usual when you modify the grant tables directly, you must tell the server to reload them with FLUSH PRIVILEGES so that the privilege changes take effect.

...

  • 0
  Wilhelmus said:

From MySQL manual:

The problem is though, when I try to tell it to flush privileges, it 'dies', and I get an error that I specified in the PHP code.

When I go to phpMyAdmin, I can view the new entries. When I go to sign in using the credentials I added to the database using the login script, I am able to login. Do I need to use flush privileges?

Smctainsh

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.