IT Questions and Answers :)

Wednesday, March 27, 2019

In MYSQL, what is the command used to reload the grant tables?

In MYSQL, what is the command used to reload the grant tables?

  • PRIVILEGES RELOAD;
  • FLUSH PRIVILEGES;
  • RELOAD GRANT;
  • UPDATE PRIVILEGES; 

 

EXPLANATION


Privileges assigned through GRANT option do not need FLUSH PRIVILEGES to take effect - MySQL server will notice these changes and reload the grant tables immediately.
From MySQL documentation:
If you modify the grant tables directly using statements such as INSERT, UPDATE, or DELETE, your changes have no effect on privilege checking until you either restart the server or tell it to reload the tables. If you change the grant tables directly but forget to reload them, your changes have no effect until you restart the server. This may leave you wondering why your changes seem to make no difference! 


To tell the server to reload the grant tables, perform a flush-privileges operation. This can be done by issuing a FLUSH
PRIVILEGES statement or by executing a mysqladmin flush-privileges or mysqladmin reload command.

SOURCE

https://dev.mysql.com/doc/refman/8.0/en/privilege-changes.html
Share:

Tuesday, March 20, 2018

What MySQL feature allows for queries to be run periodically in the background, independent of a front-end program?

What MySQL feature allows for queries to be run periodically in the background, independent of a front-end program?

  • MySQL Automatic Events
  • MySQL Task Manager
  • MySQL Event Scheduler
  • MySQL Scheduled Tasks 

 
What MySQL feature allows for queries to be run periodically in the background, independent of a front-end program?

EXPLANATION

The MySQL Event Scheduler allows for queries to be run in the background at scheduled times, either as a one-off or recurring event.

SOURCE

https://dev.mysql.com/doc/refman/5.7/en/events-overview.html
Share:

Wednesday, November 22, 2017

Which of the following is always true in a MySQL database?

Which of the following is always true in a MySQL database?

  • Foreign keys cannot contain duplicate data
  • Foreign keys must always refer to an indexed column
  • Foreign keys cannot contain null
  • Foreign keys must only ever be numeric 
Which of the following is always true in a MySQL database?

EXPLANATION

In MySQL, a foreign key must always refer to an indexed column. A foreign key may contain duplicate data or nulls, and can even be textual in nature.The requirement on indexing is for performance reasons, and if your table is an InnoDB table, an index may be created automatically for any foreign key you create, if one does not already exist.

SOURCE

https://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html
Share:

Popular Posts