[Serusers] SER cannot connect to MySQL Server
Jan Janak
jan at iptel.org
Wed Oct 26 08:29:08 CEST 2005
Maybe your mysql server is listening on TCP socket only. You can try to
changee the database URL in ser:
modparam("auth_db|usrloc", "mysql://ser:heslo@127.0.0.1/ser")
Jan.
On 10-10-2005 14:51, romulus wrote:
> HI, I'm using Debian Linux(while I have no idea how to check its version), and running SER on my PC.
> I installed MySQL 4.1.14 and SER 0.9.4, chmoded the /tmp directory to 777, and the MySQL server runs well.
> But when I start SER, it does not run and leaves some error message in syslog like this:
> --------------------------------------------------------------------------------------------
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: Maxfwd module- initializing
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: new_connection(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: db_init(): Could not create a connection
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: ERROR: auth_db_ver: unable to open database connection
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: auth_db:str_fixup(): Error while querying table version
> Oct 10 14:31:03 Serverhost /usr/sbin/ser[6525]: ERROR: fix_expr : fix_actions error
> --------------------------------------------------------------------------------------------
> The file /var/run/mysqld/mysqld.sock doest not exist, but the MySQL still runs well. I also don't know if it is correct.
> Does anyone know how to resolve this? Thank you!
>
> ser.cfg, "gulab.twbbs.org" is my domain.
> --------------------------------------------------------------------------------------------
> #
> # $Id: ser.cfg,v 1.25.2.1 2005/02/18 14:30:44 andrei Exp $
> #
> # simple quick-start config script
> #
>
> # ----------- global configuration parameters ------------------------
>
> #debug=3 # debug level (cmd line: -dddddddddd)
> #fork=yes
> #log_stderror=no # (cmd line: -E)
>
> /* Uncomment these lines to enter debugging mode
> fork=no
> log_stderror=yes
> */
>
> check_via=no # (cmd. line: -v)
> dns=no # (cmd. line: -r)
> rev_dns=no # (cmd. line: -R)
> #port=5060
> #children=4
> fifo="/tmp/ser_fifo"
>
> # ------------------ module loading ----------------------------------
>
> # Uncomment this if you want to use SQL database
> loadmodule "/usr/lib/ser/modules/mysql.so"
>
> loadmodule "/usr/lib/ser/modules/sl.so"
> loadmodule "/usr/lib/ser/modules/tm.so"
> loadmodule "/usr/lib/ser/modules/rr.so"
> loadmodule "/usr/lib/ser/modules/maxfwd.so"
> loadmodule "/usr/lib/ser/modules/usrloc.so"
> loadmodule "/usr/lib/ser/modules/registrar.so"
> loadmodule "/usr/lib/ser/modules/textops.so"
>
> # Uncomment this if you want digest authentication
> # mysql.so must be loaded !
> loadmodule "/usr/lib/ser/modules/auth.so"
> loadmodule "/usr/lib/ser/modules/auth_db.so"
>
> # ----------------- setting module-specific parameters ---------------
>
> # -- usrloc params --
>
>
> #modparam("usrloc", "db_mode", 0)
>
> # Uncomment this if you want to use SQL database
> # for persistent storage and comment the previous line
> modparam("usrloc", "db_mode", 2)
>
> # -- auth params --
> # Uncomment if you are using auth module
> #
> modparam("auth_db", "calculate_ha1", yes)
> #
> # If you set "calculate_ha1" parameter to yes (which true in this config),
> # uncomment also the following parameter)
> #
> modparam("auth_db", "password_column", "password")
>
> # -- rr params --
> # add value to ;lr param to make some broken UAs happy
> modparam("rr", "enable_full_lr", 1)
>
> # ------------------------- request routing logic -------------------
>
> # main routing logic
>
> route{
>
> # initial sanity checks -- messages with
> # max_forwards==0, or excessively long requests
> if (!mf_process_maxfwd_header("10")) {
> sl_send_reply("483","Too Many Hops");
> break;
> };
> if (msg:len >= 2048 ) {
> sl_send_reply("513", "Message too big");
> break;
> };
>
>
>
> # we record-route all messages -- to make sure that
> # subsequent messages will go through our proxy; that's
> # particularly good if upstream and downstream entities
> # use different transport protocol
> if (!method=="REGISTER") record_route();
>
> # subsequent messages withing a dialog should take the
> # path determined by record-routing
> if (loose_route()) {
> # mark routing logic in request
> append_hf("P-hint: rr-enforced\r\n");
> route(1);
> break;
> };
>
> if (!uri==myself) {
> # mark routing logic in request
> append_hf("P-hint: outbound\r\n");
> route(1);
> break;
> };
>
>
> # if the request is for other domain use UsrLoc
> # (in case, it does not work, use the following command
> # with proper names and addresses in it)
> if (uri=~"gulab.twbbs.org") {
>
> if (method=="REGISTER") {
>
> # Uncomment this if you want to use digest authentication
> if (!www_authorize("gulab.twbbs.org", "subscriber")) {
> www_challenge("gulab.twbbs.org", "0");
> break;
> };
>
> save("location");
> break;
> };
>
> lookup("aliases");
> if (!uri==myself) {
> append_hf("P-hint: outbound alias\r\n");
> route(1);
> break;
> };
>
> break;
> };
>
> # native SIP destinations are handled using our USRLOC DB
> if (!lookup("location")) {
> sl_send_reply("404", "Not Found");
> break;
> };
> };
> append_hf("P-hint: usrloc applied\r\n");
> route(1);
> }
>
> route[1]
> {
> # send it out now; use stateful forwarding as it works reliably
> # even for UDP2TCP
> if (!t_relay()) {
> sl_reply_error();
> };
> }
>
> --------------------------------------------------------------------------------------------
> my.cnf
> --------------------------------------------------------------------------------------------
> #
> # The MySQL database server configuration file.
> #
> # You can copy this to one of:
> # - "/etc/mysql/my.cnf" to set global options,
> # - "/var/lib/mysql/my.cnf" to set server-specific options or
> # - "~/.my.cnf" to set user-specific options.
> #
> # One can use all long options that the program supports.
> # Run program with --help to get a list of available options and with
> # --print-defaults to see which it would actually understand and use.
> #
> # For explanations see
> # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
>
> # This will be passed to all mysql clients
> # It has been reported that passwords should be enclosed with ticks/quotes
> # escpecially if they contain "#" chars...
> # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
> [client]
> port = 3306
> socket = /var/run/mysqld/mysqld.sock
>
> # Here is entries for some specific programs
> # The following values assume you have at least 32M ram
>
> # This was formally known as [safe_mysqld]. Both versions are currently parsed.
> [mysqld_safe]
> socket = /var/run/mysqld/mysqld.sock
> nice = 0
>
> [mysqld]
> #
> # * Basic Settings
> #
> user = mysql
> pid-file = /var/run/mysqld/mysqld.pid
> socket = /var/run/mysqld/mysqld.sock
> port = 3306
> basedir = /usr
> datadir = /var/lib/mysql
> tmpdir = /tmp
> language = /usr/share/mysql/english
> skip-external-locking
> #
> # For compatibility to other Debian packages that still use
> # libmysqlclient10 and libmysqlclient12.
> old_passwords = 1
> #
> # Instead of skip-networking the default is now to listen only on
> # localhost which is more compatible and is not less secure.
> bind-address = 127.0.0.1
> #
> # * Fine Tuning
> #
> key_buffer = 16M
> max_allowed_packet = 16M
> thread_stack = 128K
> #
> # * Query Cache Configuration
> #
> query_cache_limit = 1048576
> query_cache_size = 16777216
> query_cache_type = 1
> #
> # * Logging and Replication
> #
> # Both location gets rotated by the cronjob.
> # Be aware that this log type is a performance killer.
> #log = /var/log/mysql.log
> #log = /var/log/mysql/mysql.log
> #
> # Error logging goes to syslog. This is a Debian improvement :)
> #
> # Here you can see queries with especially long duration
> #log-slow-queries = /var/log/mysql/mysql-slow.log
> #
> # The following can be used as easy to replay backup logs or for replication.
> #server-id = 1
> log-bin = /var/log/mysql/mysql-bin.log
> # See /etc/mysql/debian-log-rotate.conf for the number of files kept.
> max_binlog_size = 104857600
> #binlog-do-db = include_database_name
> #binlog-ignore-db = include_database_name
> #
> # * BerkeleyDB
> #
> # According to an MySQL employee the use of BerkeleyDB is now discouraged
> # and support for it will probably cease in the next versions.
> skip-bdb
> #
> # * InnoDB
> #
> # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
> # Read the manual for more InnoDB related options. There are many!
> #
> # * Security Features
> #
> # Read the manual, too, if you want chroot!
> # chroot = /var/lib/mysql/
> #
> # If you want to enable SSL support (recommended) read the manual or my
> # HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
> # ssl-ca=/etc/mysql/cacert.pem
> # ssl-cert=/etc/mysql/server-cert.pem
> # ssl-key=/etc/mysql/server-key.pem
>
>
>
> [mysqldump]
> quick
> quote-names
> max_allowed_packet = 16M
>
> [mysql]
> #no-auto-rehash # faster start of mysql but no tab completition
>
> [isamchk]
> key_buffer = 16M
>
> #
> # * NDB Cluster
> #
> # See /usr/share/doc/mysql-server-*/README.Debian for more information.
> #
> # The following configuration is read by the ndbd storage daemons,
> # not from the ndb_mgmd management daemon.
> #
> # [MYSQL_CLUSTER]
> # ndb-connectstring=127.0.0.1
>
> --------------------------------------------------------------------------------------------
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
More information about the sr-users
mailing list