• 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.
  • Posts

    • Plenty of info (benchmarks etc) out there about how turning off e-cores can increase performance in certain workloads. Which tells me that Microsoft or Intel can’t get this mess of cores sorted out. At work we have this lab and someone was testing (TrueNas performance testing) ESXi on a white box setup that had a 13700K in it and ESXi would purple screen every time until they turned off ecores.
    • I've been using OneDrive for photos and documents since Windows 8.1 came out and it's been the best way to keep a backup of what I have. I also use GoogleDrive on my phone with Android 15 to back up my phone. Over the past 12 years, I've seen people losing data on their PC or phone because they don't use cloud services. Even though I warn them to use them. Especially those who make money working on their PC with thousands of files. A 1TB cloud service is extremely cheap these days and there's no reason for you not to use one. I've seen people losing valuable data on their phone because they don't use GoogleDrive on their phone and this is much more common than on a PC. On Windows, I've seen people having hardware problems with their HD and SSD and losing all their data just because they refused to use OneDrive, which offered the backup option. There's still an external SSD as a second copy to be used together with your OneDrive. Bitlocker is completely safe, you will only have problems with it if you use bad programs that mess with the integrity of Windows. Your iPhone and Android also have encryption and if you mess with the system gears it can bug and you can lose your data too. Windows 11 is perfect if used correctly. But people are stupid enough to buy a brand new car, open the engine and start messing with it until it stops working, and then go to the car manufacturer to complain that it stopped working just because the user messed up the engine.
    • Hey it's not my fault a politician's team made a tech blunder; a significant one at that, is it?
  • Recent Achievements

    • One Month Later
      mevinyavin earned a badge
      One Month Later
    • Week One Done
      rozermack875 earned a badge
      Week One Done
    • Week One Done
      oneworldtechnologies earned a badge
      Week One Done
    • Veteran
      matthiew went up a rank
      Veteran
    • Enthusiast
      Motoman26 went up a rank
      Enthusiast
  • Popular Contributors

    1. 1
      +primortal
      684
    2. 2
      ATLien_0
      266
    3. 3
      Michael Scrip
      196
    4. 4
      +FloatingFatMan
      181
    5. 5
      Steven P.
      140
  • Tell a friend

    Love Neowin? Tell a friend!