<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 5:  MySQL Optimisation 369 5.5.6  SET Syntax SET [GLOBAL | SESSION] sql_variable=expression, [[GLOBAL | SESSION] sql_ SET sets various options that a ect the operation of the server or your client. The following examples shows the di erent syntaxes one can use to set variables: In old MySQL versions we allowed the use of the SET OPTION syntax, but this syntax is now deprecated. In MySQL 4.0.3 we added the GLOBAL and SESSION options and access to most important startup variables. LOCAL  can be used as a synonym for  SESSION. If  you  set  several  variables  on  the  same  command  line,  the  last  used  GLOBAL | SESSION mode is used. SET sort_buffer_size=10000; SET @@local.sort_buffer_size=10000; SET GLOBAL sort_buffer_size=1000000, SESSION sort_buffer_size=1000000; SET @@sort_buffer_size=1000000; SET @@global.sort_buffer_size=1000000, @@local.sort_buffer_size=1000000; The @@variable_name syntax is supported to make MySQL syntax compatible with some other databases. The di erent system variables one can set are described in the system variable section of this manual.  See Section 6.1.5 [System Variables], page 381. If you are using SESSION (the default) the option you set remains in e ect until the current session  ends,  or  until  you  set  the  option  to  a  di erent  value.   If  you  use  GLOBAL,  which require the SUPER privilege, the option is remembered and used for new connections until the server restarts.  If you want to make an option permanent, you should set it in one of the MySQL option les.  See Section 4.1.2 [Option les], page 186. To  avoid  wrong  usage  MySQL  will  give  an  error  if  you  use  SET GLOBAL  with  a  variable that can only be used with SET SESSION or if you are not using SET GLOBAL with a global variable. If you want to set a SESSION variable to the GLOBAL value or a GLOBAL value to the MySQL default value, you can set it to DEFAULT. SET max_join_size=DEFAULT; This is idential to: SET @@session.max_join_size=@@global.max_join_size; If  you  want  to  restrict  the  maximum  value  a  startup  option  can  be  set  to  with  the  SET command,  you  can  specify  this  by  using  the  --maximum-variable-name  command  line option.  See Section 4.1.1 [Command-line options], page 181. You can get a list of most variables with SHOW VARIABLES. See Section 4.5.6.4 [SHOW VARI- ABLES], page 257. You can get the value for a speci c value with the @@[global.|local. name  syntax: SHOW VARIABLES like "max_join_size"; SHOW GLOBAL VARIABLES like "max_join_size";
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide