You are here : Cmysql/mysql.hmysql_refresh

mysql_refresh() - mysql/mysql.h

 Note


          As of MySQL 5.7.11, mysql_refresh() is
          deprecated and will be removed in a future version of MySQL.
          Instead, use mysql_query() to
          execute a FLUSH statement.NoteAs of MySQL 5.7.11, mysql_refresh() is
          deprecated and will be removed in a future version of MySQL.
          Instead, use mysql_query() to
          execute a FLUSH statement.mysql_refresh()mysql_query()mysql_query()FLUSHFLUSHThis function flushes tables or caches, or resets replication
        server information. The connected user must have the
        RELOAD privilege.RELOADRELOADThe options argument is a bit mask composed
        from any combination of the following values. Multiple values
        can be OR'ed together to perform multiple operations with a
        single call.optionsREFRESH_GRANT

            Refresh the grant tables, like
            FLUSH
            PRIVILEGES.
          
REFRESH_LOG

            Flush the logs, like
            FLUSH LOGS.
          
REFRESH_TABLES

            Flush the table cache, like
            FLUSH
            TABLES.
          
REFRESH_HOSTS

            Flush the host cache, like
            FLUSH
            HOSTS.
          
REFRESH_STATUS

            Reset status variables, like
            FLUSH
            STATUS.
          
REFRESH_THREADS

            Flush the thread cache.
          
REFRESH_SLAVE

            On a slave replication server, reset the master server
            information and restart the slave, like
            RESET SLAVE.
          
REFRESH_MASTER

            On a master replication server, remove the binary log files
            listed in the binary log index and truncate the index file,
            like RESET MASTER.REFRESH_GRANT

            Refresh the grant tables, like
            FLUSH
            PRIVILEGES.
          
REFRESH_LOG

            Flush the logs, like
            FLUSH LOGS.
          
REFRESH_TABLES

            Flush the table cache, like
            FLUSH
            TABLES.
          
REFRESH_HOSTS

            Flush the host cache, like
            FLUSH
            HOSTS.
          
REFRESH_STATUS

            Reset status variables, like
            FLUSH
            STATUS.
          
REFRESH_THREADS

            Flush the thread cache.
          
REFRESH_SLAVE

            On a slave replication server, reset the master server
            information and restart the slave, like
            RESET SLAVE.
          
REFRESH_MASTER

            On a master replication server, remove the binary log files
            listed in the binary log index and truncate the index file,
            like RESET MASTER.REFRESH_GRANT

            Refresh the grant tables, like
            FLUSH
            PRIVILEGES.REFRESH_GRANTREFRESH_GRANTRefresh the grant tables, like
            FLUSH
            PRIVILEGES.FLUSH
            PRIVILEGESFLUSH
            PRIVILEGESREFRESH_LOG

            Flush the logs, like
            FLUSH LOGS.REFRESH_LOGREFRESH_LOGFlush the logs, like
            FLUSH LOGS.FLUSH LOGSFLUSH LOGSREFRESH_TABLES

            Flush the table cache, like
            FLUSH
            TABLES.REFRESH_TABLESREFRESH_TABLESFlush the table cache, like
            FLUSH
            TABLES.FLUSH
            TABLESFLUSH
            TABLESREFRESH_HOSTS

            Flush the host cache, like
            FLUSH
            HOSTS.REFRESH_HOSTSREFRESH_HOSTSFlush the host cache, like
            FLUSH
            HOSTS.FLUSH
            HOSTSFLUSH
            HOSTSREFRESH_STATUS

            Reset status variables, like
            FLUSH
            STATUS.REFRESH_STATUSREFRESH_STATUSReset status variables, like
            FLUSH
            STATUS.FLUSH
            STATUSFLUSH
            STATUSREFRESH_THREADS

            Flush the thread cache.REFRESH_THREADSREFRESH_THREADSFlush the thread cache.REFRESH_SLAVE

            On a slave replication server, reset the master server
            information and restart the slave, like
            RESET SLAVE.REFRESH_SLAVEREFRESH_SLAVEOn a slave replication server, reset the master server
            information and restart the slave, like
            RESET SLAVE.RESET SLAVERESET SLAVEREFRESH_MASTER

            On a master replication server, remove the binary log files
            listed in the binary log index and truncate the index file,
            like RESET MASTER.REFRESH_MASTERREFRESH_MASTEROn a master replication server, remove the binary log files
            listed in the binary log index and truncate the index file,
            like RESET MASTER.RESET MASTERRESET MASTER


Syntax

int mysql_refresh(MYSQL *mysql, unsigned int
        options)


Example

 


Output / Return Value

 Zero for success. Nonzero if an error occurred.


Limitations


Alternatives / See Also


Reference