<< 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 8:  MySQL APIs 589 Errors CR_COMMANDS_OUT_OF_SYNC Commands were executed in an improper order. CR_SERVER_GONE_ERROR The MySQL server has gone away. CR_SERVER_LOST The connection to the server was lost during the query. CR_UNKNOWN_ERROR An unknown error occurred. 8.4.3.41  mysql_real_connect() MYSQL *mysql_real_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd, const char *db, unsigned int port, const char *unix_socket, unsigned int client_flag) Description mysql_real_connect()  attempts to establish a connection to a MySQL database engine running on host.  mysql_real_connect() must complete successfully before you can exe- cute any of the other API functions, with the exception of mysql_get_client_info(). The parameters are speci ed as follows:    The   rst  parameter  should  be  the  address  of  an  existing  MYSQL  structure.   Before calling  mysql_real_connect()  you  must  call  mysql_init()  to  initialise  the  MYSQL structure.   You can change a lot of connect options with the  mysql_options()  call. See Section 8.4.3.38 [mysql options], page 586.    The  value  of  host  may  be  either  a  hostname  or  an  IP  address.   If  host  is  NULL  or the string "localhost", a connection to the local host is assumed.  If the OS supports sockets (Unix) or named pipes (Windows), they are used instead of TCP/IP to connect to the server.    The  user  parameter  contains  the  user's  MySQL  login  ID.  If  user  is  NULL,  the  cur- rent  user  is  assumed.   Under  Unix,  this  is  the  current  login  name.   Under  Windows ODBC, the current user name must be speci ed explicitly.  See Section 8.3.2 [ODBC administrator], page 547.    The passwd parameter contains the password for user.  If passwd is NULL, only entries in the user table for the user that have a blank (empty) password eld will be checked for a match.  This allows the database administrator to set up the MySQL privilege system in such a way that users get di erent privileges depending on whether or not they have speci ed a password. Note:  Do not attempt to encrypt the password before calling mysql_real_connect(); password encryption is handled automatically by the client API.    db is the database name.  If db is not NULL, the connection will set the default database to this value.
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    MERCHANT ACCOUNTS
    DEDICATED SERVERS
    E-COMMERCE HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN
    REGISTRATION
    MANAGE
    YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    Corporate Info
    ABOUT US
    OUR NETWORK
    CONTACT US
    SITE MAP
    Copyright © 2002 Dyntex Group, Inc. All Rights Reserved
  • 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