List:General Discussion« Previous MessageNext Message »
From:Duhaime Johanne Date:September 12 2006 1:43pm
Subject:2 versions of mysql on Unix: problem with the socket
View as plain text  
I am running mysql 4.1.7 on solaris 9. I want to install 2 versions (versions 4.1.7 and 
5) on the server. I am reconfiguring my scripts in that perspective.
 
I have a script that start the mysql v4 so that I finally have:
 
7002 pts/4    S  0:00 /bin/sh /seqweb/mysql4/bin/mysqld_safe
--defaults-file=/seqweb/mysqldata/my.cnf --port=3306 --socket=/tmp/mysql4.sock
--pid-file=/seqweb/mysqldata/mysql4.pid --user=mysql --datadir=/seqweb/mysqldata

  7023 pts/4    S  0:13 /seqweb/mysql-4.1.7/libexec/mysqld
--defaults-file=/seqweb/mysqldata/my.cnf --basedir=/seqweb/mysql-4.1.7
--datadir=/seqweb/mysqldata --pid-file=/seqweb/mysqldata/mysql4.pid --port=3306
--socket=/tmp/mysql4
 
The problem is that I always have to give the --socket to all the clients, the port number
is not  enough. Ex:
 
mercure{mysql}139: /seqweb/mysql4/bin/mysql --port 3306
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
(2)
mercure{mysql}140: /seqweb/mysql4/bin/mysql --port 3306 --socket /tmp/mysql4.sock
Welcome to the MySQL monitor.  
 
Of course I can do it but the problem is when I use client like a perl script with DBI:
while (<DBLIST>) {
   my $db_name=$_;
   my $port=3306;
   my $hostname='localhost';
   my $socket='/tmp/mysql4.sock';
   chomp($db_name);
   my $dsn = "DBI:mysql:database=$db_name;host=$hostname;port=$port";
 
   my $dbh = DBI->connect ($dsn,$DBUSER, $DBPASS,
                        { RaiseError => 1, PrintError => 0 })

DBI connect('database=mysql;host=localhost;port=3306','mysql',...) failed: Can't connect
to local MySQL server through socket '/tmp/mysql.sock' (2) at
/seqweb/mysql4/myscripts/4/check_innodb.pl line 58
 
 
Where is the problem? Is it in the way I start mysql?
 
I really would appreciate help! Scripts are below.
Thank you in advance
 
----------------------------------------------------------------------------
start_script:
 
#! /bin/sh
/seqweb/mysql4/bin/mysqld_safe \
--defaults-file=/seqweb/mysqldata/my.cnf \
--port=3306 \
--socket=/tmp/mysql4.sock \
--pid-file=/seqweb/mysqldata/mysql4.pid \
--user=mysql \
--datadir=/seqweb/mysqldata  &
 
 
/etc/my.conf
mercure{mysql}143: more /etc/my.cnf
[mysqldump]
quick
max_allowed_packet = 16M
 
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
 
[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
 
[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M
 
[mysqlhotcopy]
interactive-timeout
 
 
my.cnf sever side: 
more /seqweb/mysqldata/my.cnf

[client]
#password       = your_password
port            = 3306
socket          = /tmp/mysql4.sock
 

# The MySQL server
[mysqld]
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
#sort_buffer_size = 512K
sort_buffer_size = 4M #Modifié  17 aout 2004 JD 
net_buffer_length = 8K
myisam_sort_buffer_size = 8M
 
log-bin = /home/mysqldisk2/4/logs/log-bin/log_bin #aout 2006
log-slow-queries=/seqdata/static/mysql/4/logs/slow-query/log-slow-queries #aout 2006
log= /seqdata/static/mysql/4/logs/general_query_log/mercure.log #aout 2006
tmpdir =/seqdata/static/mysql/4/tmp  #aout 2006


thread_cache = 16 #Modifié  17 aout 2004 JD
read_rnd_buffer_size=2M #Modifié  17 aout 2004 JD
innodb_file_per_table 
 
log-bin
 
# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1
 

innodb_data_home_dir = /home/mysqldisk3/innodb/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir =  /home/mysqldisk2/4/logs/innodb_logfiles/logfiles #aout 2006
innodb_log_arch_dir = /home/mysqldisk2/innodb_logfiles/log_arch_files 
innodb_buffer_pool_size = 500M #Modifié le 1out 2004 JD 
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 100M 
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

Johanne Duhaime
duhaimj@stripped

Thread
2 versions of mysql on Unix: problem with the socketDuhaime Johanne12 Sep
  • Re: 2 versions of mysql on Unix: problem with the socketGerald L. Clark12 Sep
RE: 2 versions of mysql on Unix: problem with the socketDuhaime Johanne12 Sep