The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Per user mysql connection settings

Discussion in 'General Discussion' started by ivankovalenko, Sep 7, 2005.

  1. ivankovalenko

    ivankovalenko Active Member

    Joined:
    Jul 19, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Is there a way to set up php in cgi mod to or may be mysql to use special charset encoding when connecting scripts to mysql dbase? (Mysql 4.1.x)
    Say, i have 2 users.
    User 1 have latin1 as charset_results
    User 2 have cp1251 as charset_results
    How can i or them selfes define the charset for results from mysql?
     
  2. web12

    web12 Well-Known Member

    Joined:
    Nov 20, 2002
    Messages:
    240
    Likes Received:
    0
    Trophy Points:
    16
    Hi

    Sorry to bring up an old thread, but did you find a way to do this?

    thanks
     
  3. ivankovalenko

    ivankovalenko Active Member

    Joined:
    Jul 19, 2005
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    As far as i could get i found this :
    1. In current configuration php doesnt read any defaults file that can change behavior for this.
    2. There is no standard configuration using which you can get what you want.
    3. The only way to make php change its charset on connection patch ext/php_mysql.c with adding some options to mysql object and hope it will not break nor make a hole in your servers security.
    As for mysql itself - it cant do anything on per-dbase basis. Only specify some opts for db (look mysql man).

    So overall answer - the only way to do it - patch ext/php_mysql.c and supply account directory with .my.cnf file where connection options are defined.
     
Loading...

Share This Page