Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of SockFile


Ignore:
Timestamp:
02/09/06 19:50:49 (13 years ago)
Author:
bjourne@…
Comment:

You don't have to specify localhost

Legend:

Unmodified
Added
Removed
Modified
  • SockFile

    v3 v4  
    55== Situation == 
    66 
    7 There is a practice of not binding MySQL to an ip address and port following the principle that "if you're not connected, you are protected." In this situation, the server has a socket file. By default TurboGears (or SQLObject and the python MySQL driver/client to be more exact) will look for the socket file in /tmp/mysql.sock. Many installations seem to use /var/lib/mysql/mysql.sock. Therefore, to get TurboGears to work, you'll need to specify the unix_socket (if on unix) param in the dburi. 
     7There is a practice of not binding MySQL to an ip address and port following the principle that "if you're not connected, you are protected." In this situation, the server has a socket file. By default TurboGears (or SQLObject and the python MySQL driver/client to be more exact) will look for the socket file in /tmp/mysql.sock. Many installations seem to use /var/lib/mysql/mysql.sock. Therefore, to get TurboGears to work, you'll need to specify the unix_socket (if on unix) param in the dburi. You can find out where your mysql socket is by looking at the file my.cnf that usually resides in /etc/my.cnf or /etc/mysql/my.cnf.  
    88 
    9 Format: sqlobject.dburi="!mysql://username:password@localhost/databasename?unix_socket=path-to-mysql.sock" 
     9Format: sqlobject.dburi="!mysql://username:password@/databasename?unix_socket=path-to-mysql.sock" 
    1010 
    11 Example: I have my socket file in /var/lib/mysql/mysql.sock and I want my user foo with password bar to connect to my db test1. sqlobject.dburi="!mysql:/foo:bar@localhost/test1?unix_socket=/var/lib/mysql/mysql.sock"  
     11Example: I have my socket file in /var/lib/mysql/mysql.sock and I want my user foo with password bar to connect to my db test1. sqlobject.dburi="!mysql:/foo:bar@/test1?unix_socket=/var/lib/mysql/mysql.sock"