Starting a 2nd MySQL instance on UNIX

Starting a 2nd MySQL instance on UNIX

am 23.04.2008 20:43:20 von Mark-E

I have a Solaris box where MySQL 4.0.20 instance is running (to support
Bugzilla 2.22). I have loaded mysql5.0 on the same box (for Bugzilla 3.0.3)
and created a new mysql50 user that I want to use to run this instance with.
I tried to start the instance on another port by running the following
command...

../bin/mysqld_safe --defaults-file=/usr/local/mysql-5.0/my.cnf
--socket=/tmp/mysql50/mysql.sock --port=3307 --basedir=/usr/local/mysql-5.0
--datadir=/usr/local/mysql-5.0/data
--pid-file=/usr/local/mysql-5.0/mysql50.pid --user=mysql50

The instance appears to start but the message "Starting the instance" comes
up and I never get back to the system prompt. it just sits there. If I open
another terminal window and do a ps -ef | grep mysql, I can see the new
processes running. There is nothing in the error log.

I ran the mysql_install_db.sh script to create the mysql database however, I
cannot log in. I thought that it creates a root user with no password. I
tired logging in as root with no password bu no luck. If i use the mysql
4.0.20 root user password, I get into the 4.0.20 instance even though the
mysql50 user does not have mysql 4.0.20 in it's path. when I run mysql at
the prompt, how would I differentiate between the 2 instances?

So at this point I am stuck. If anyone out can help guide me on what I need
to do to ge tthe instance up and running properly, I would appreciate it. I
am rather new to MySQL and I have read through the docs but things are still
not very clear.


Thanks!

Mark
--
View this message in context: http://www.nabble.com/Starting-a-2nd-MySQL-instance-on-UNIX- tp16834758p16834758.html
Sent from the MySQL - General mailing list archive at Nabble.com.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Starting a 2nd MySQL instance on UNIX

am 24.04.2008 10:14:34 von Ian Simpson

Mark,

When you try to log-in to the new instance, are you specifying the new
port number to the client? If you don't give it the new port number,
then it will connect to the default port, which is presumably your
4.0.20 instance.

Mark-E wrote:
> I have a Solaris box where MySQL 4.0.20 instance is running (to support
> Bugzilla 2.22). I have loaded mysql5.0 on the same box (for Bugzilla 3.0.3)
> and created a new mysql50 user that I want to use to run this instance with.
> I tried to start the instance on another port by running the following
> command...
>
> ./bin/mysqld_safe --defaults-file=/usr/local/mysql-5.0/my.cnf
> --socket=/tmp/mysql50/mysql.sock --port=3307 --basedir=/usr/local/mysql-5.0
> --datadir=/usr/local/mysql-5.0/data
> --pid-file=/usr/local/mysql-5.0/mysql50.pid --user=mysql50
>
> The instance appears to start but the message "Starting the instance" comes
> up and I never get back to the system prompt. it just sits there. If I open
> another terminal window and do a ps -ef | grep mysql, I can see the new
> processes running. There is nothing in the error log.
>
> I ran the mysql_install_db.sh script to create the mysql database however, I
> cannot log in. I thought that it creates a root user with no password. I
> tired logging in as root with no password bu no luck. If i use the mysql
> 4.0.20 root user password, I get into the 4.0.20 instance even though the
> mysql50 user does not have mysql 4.0.20 in it's path. when I run mysql at
> the prompt, how would I differentiate between the 2 instances?
>
> So at this point I am stuck. If anyone out can help guide me on what I need
> to do to ge tthe instance up and running properly, I would appreciate it. I
> am rather new to MySQL and I have read through the docs but things are still
> not very clear.
>
>
> Thanks!
>
> Mark
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Starting a 2nd MySQL instance on UNIX

am 28.04.2008 17:54:40 von Mark-E

Hi Ian,
Thanks for the reply. I was specifying the new port of 3307. I actually
got it working over the weekend. Turns out I had to add a few entries in the
mysqld section of the my.cnf file and I was able to connect.

Regards,
Mark



Ian Simpson wrote:
>
> Mark,
>
> When you try to log-in to the new instance, are you specifying the new
> port number to the client? If you don't give it the new port number,
> then it will connect to the default port, which is presumably your
> 4.0.20 instance.
>
> Mark-E wrote:
>> I have a Solaris box where MySQL 4.0.20 instance is running (to support
>> Bugzilla 2.22). I have loaded mysql5.0 on the same box (for Bugzilla
>> 3.0.3)
>> and created a new mysql50 user that I want to use to run this instance
>> with.
>> I tried to start the instance on another port by running the following
>> command...
>>
>> ./bin/mysqld_safe --defaults-file=/usr/local/mysql-5.0/my.cnf
>> --socket=/tmp/mysql50/mysql.sock --port=3307
>> --basedir=/usr/local/mysql-5.0
>> --datadir=/usr/local/mysql-5.0/data
>> --pid-file=/usr/local/mysql-5.0/mysql50.pid --user=mysql50
>>
>> The instance appears to start but the message "Starting the instance"
>> comes
>> up and I never get back to the system prompt. it just sits there. If I
>> open
>> another terminal window and do a ps -ef | grep mysql, I can see the new
>> processes running. There is nothing in the error log.
>>
>> I ran the mysql_install_db.sh script to create the mysql database
>> however, I
>> cannot log in. I thought that it creates a root user with no password. I
>> tired logging in as root with no password bu no luck. If i use the mysql
>> 4.0.20 root user password, I get into the 4.0.20 instance even though the
>> mysql50 user does not have mysql 4.0.20 in it's path. when I run mysql at
>> the prompt, how would I differentiate between the 2 instances?
>>
>> So at this point I am stuck. If anyone out can help guide me on what I
>> need
>> to do to ge tthe instance up and running properly, I would appreciate it.
>> I
>> am rather new to MySQL and I have read through the docs but things are
>> still
>> not very clear.
>>
>>
>> Thanks!
>>
>> Mark
>>
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@nabble.com
>
>
>

--
View this message in context: http://www.nabble.com/Starting-a-2nd-MySQL-instance-on-UNIX- tp16834758p16941984.html
Sent from the MySQL - General mailing list archive at Nabble.com.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Starting a 2nd MySQL instance on UNIX

am 29.04.2008 15:28:57 von Arthur Fuller

------=_Part_13292_10010443.1209475737383
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Would you kindly supply the changes you made, for our collective education?
Thanks.

Arthur

On Mon, Apr 28, 2008 at 11:54 AM, Mark-E wrote:

>
> Hi Ian,
> Thanks for the reply. I was specifying the new port of 3307. I actually
> got it working over the weekend. Turns out I had to add a few entries in
> the
> mysqld section of the my.cnf file and I was able to connect.
>
> Regards,
> Mark
>

------=_Part_13292_10010443.1209475737383--

RE: Starting a 2nd MySQL instance on UNIX

am 29.04.2008 15:54:15 von Mark-E

--_000_4CF0432647A0E5449D404B5B13B8668DCAE4236B5FWINHBSMAIL0 1h_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Arthur,
Sure, no problem!

This actually proved to be rather tricky because the first instance was ins=
talled in /usr/local/mysql. It seems that by default, MySQL looks for thing=
s in this locations so if you deviate from it, you have to be explicit with=
mysql and tell it where to look for things. My new MySQL 50 instance had =
to run alongside the 4.0.20 instance so I installed it into /usr/local/mysq=
l-50

** Here is a summary of things I had to do to bring this up properly **

I created a my.cnf and put it in /usr/local/mysql-50

In the my.cnf, I defined the following (The first entry is for the mysql pr=
ogram and the 2nd entry is for the mysqld program).

[mysql]
socket=3D/tmp/mysql50/mysql.sock
port=3D3307

[mysqld]
user=3Dmysql5
pid-file=3D/usr/local/mysql-50/mysql50.pid
log=3D/usr/local/mysql-50/mysql50d.log
port=3D3307
max_allowed_packet=3D32M <== I had to set this so I could import the =
MySQL 4.0.20 database properly. Some users may not need this set as high.
socket=3D/tmp/mysql50/mysql.sock

#Path to installation directory. All paths are usually resolved relative to=
this.
basedir=3D"/usr/local/mysql-50"

#Path to the database root
datadir=3D"/usr/local/mysql-50/data"

You have to be careful to not only pick a separate port, but also a separat=
e pid file for the process ID and a separate socket file, especially if you=
are running both instance at the same time.

I modified the mysql.server in the /support-files folder. I had to set the =
basedir and the datadir. I then copied this to the /bin folder.

I edited the mysql_install_db file in the /scripts folder and set the based=
ir and datadir. I then ran that to create the mysql database.

As root, I started the server ./bin/mysql.server start (The server starts =
up :) ). Since the user mysql50 is defined in this script, it then starts m=
ysqld as the mysql50 user.

Now, the tricky part, to run mysql and access the mysql database, you canno=
t just say mysql -u root -p mysql, it will try to connect to the default in=
stance in /usr/local/mysql.
What you have to do is:

Mysql --defaults-file=3D/usr/local/mysql-50/my.cnf -u root -p mysql

This now properly connects to the new mysql50 instance. Also, if you want t=
o run mysqladmin, you need to specify the --defaults-file option. Make sur=
e wherever you use the --defaults-file option that it is the FIRST command =
line option used.

It took me quite some time to get this all working but now, I understand My=
SQL much better. I hope this proves to be some help to you and others out t=
here who may be going through the same thing.

Regards,
Mark




From: Arthur Fuller [mailto:fuller.artful@gmail.com]
Sent: Tuesday, April 29, 2008 9:29 AM
To: Eramo, Mark
Cc: mysql@lists.mysql.com
Subject: Re: Starting a 2nd MySQL instance on UNIX

Would you kindly supply the changes you made, for our collective education?=
Thanks.

Arthur
On Mon, Apr 28, 2008 at 11:54 AM, Mark-E edu>> wrote:

Hi Ian,
Thanks for the reply. I was specifying the new port of 3307. I actually
got it working over the weekend. Turns out I had to add a few entries in th=
e
mysqld section of the my.cnf file and I was able to connect.

Regards,
Mark


--_000_4CF0432647A0E5449D404B5B13B8668DCAE4236B5FWINHBSMAIL0 1h_--

R: Starting a 2nd MySQL instance on UNIX

am 29.04.2008 16:12:02 von Claudio Nanni

Hello,

I faced this issues a few years ago and I'd like to give my contributions=

The easy and clean way I've found:

------------------------------------------------------------ ----------
<--> One installation for each mysql instance

<--> On each instance you can have as many databases as you want.

<--> One different mysql user and homedir (mysql41,mysql50) for each mysq=
l installation.

<--> Put .my.cnf file in the home directory of each mysql user with the r=
ight parameters (different ports and socket files at least, this is the w=
ay I have found not to conflict between instances)
Ex:
:-----.my.cnf------------:
# The MySQL server
[mysqld]
port =3D 3515
socket =3D /tmp/mysql5015.sock
skip-locking
key_buffer =3D 256M
max_allowed_packet =3D 1M
:-------------------------:

<--> Start each mysql instance with his own user
------------------------------------------------------------ ----------


In this way I have several MySQL server instances (from 3.23 to 5.x) wond=
erfully working on the same 2.7 Solaris machine.

Aloha!

Claudio Nanni

-----Messaggio originale-----
Da: Eramo, Mark [mailto:meramo@hbs.edu]=20
Inviato: martedì 29 aprile 2008 15.54
A: Arthur Fuller
Cc: mysql@lists.mysql.com
Oggetto: RE: Starting a 2nd MySQL instance on UNIX

Hi Arthur,
Sure, no problem!

This actually proved to be rather tricky because the first instance was i=
nstalled in /usr/local/mysql. It seems that by default, MySQL looks for t=
hings in this locations so if you deviate from it, you have to be explici=
t with mysql and tell it where to look for things. My new MySQL 50 insta=
nce had to run alongside the 4.0.20 instance so I installed it into /usr/=
local/mysql-50

** Here is a summary of things I had to do to bring this up properly **

I created a my.cnf and put it in /usr/local/mysql-50

In the my.cnf, I defined the following (The first entry is for the mysql =
program and the 2nd entry is for the mysqld program).

[mysql]
socket=3D/tmp/mysql50/mysql.sock
port=3D3307

[mysqld]
user=3Dmysql5
pid-file=3D/usr/local/mysql-50/mysql50.pid
log=3D/usr/local/mysql-50/mysql50d.log
port=3D3307
max_allowed_packet=3D32M <== I had to set this so I could import th=
e MySQL 4.0.20 database properly. Some users may not need this set as hig=
h.
socket=3D/tmp/mysql50/mysql.sock

#Path to installation directory. All paths are usually resolved relative =
to this.
basedir=3D"/usr/local/mysql-50"

#Path to the database root
datadir=3D"/usr/local/mysql-50/data"

You have to be careful to not only pick a separate port, but also a separ=
ate pid file for the process ID and a separate socket file, especially if=
you are running both instance at the same time.

I modified the mysql.server in the /support-files folder. I had to set th=
e basedir and the datadir. I then copied this to the /bin folder.

I edited the mysql_install_db file in the /scripts folder and set the bas=
edir and datadir. I then ran that to create the mysql database.

As root, I started the server ./bin/mysql.server start (The server start=
s up :) ). Since the user mysql50 is defined in this script, it then star=
ts mysqld as the mysql50 user.

Now, the tricky part, to run mysql and access the mysql database, you can=
not just say mysql -u root -p mysql, it will try to connect to the defaul=
t instance in /usr/local/mysql.
What you have to do is:

Mysql --defaults-file=3D/usr/local/mysql-50/my.cnf -u root -p mysql

This now properly connects to the new mysql50 instance. Also, if you want=
to run mysqladmin, you need to specify the --defaults-file option. Make=
sure wherever you use the --defaults-file option that it is the FIRST co=
mmand line option used.

It took me quite some time to get this all working but now, I understand =
MySQL much better. I hope this proves to be some help to you and others o=
ut there who may be going through the same thing.

Regards,
Mark




From: Arthur Fuller [mailto:fuller.artful@gmail.com]
Sent: Tuesday, April 29, 2008 9:29 AM
To: Eramo, Mark
Cc: mysql@lists.mysql.com
Subject: Re: Starting a 2nd MySQL instance on UNIX

Would you kindly supply the changes you made, for our collective educatio=
n? Thanks.

Arthur
On Mon, Apr 28, 2008 at 11:54 AM, Mark-E s.edu>> wrote:

Hi Ian,
Thanks for the reply. I was specifying the new port of 3307. I actually
got it working over the weekend. Turns out I had to add a few entries in =
the
mysqld section of the my.cnf file and I was able to connect.

Regards,
Mark



"Questo messaggio ed ogni suo allegato sono confidenziali e possono esser=
e riservati o, comunque, protetti dall'essere diffusi. Se il ricevente no=
n é il destinatario diretto del presente messaggio, é pregato d=
i contattare l'originario mittente e di cancellare questo messaggio ed og=
ni suo allegato dal sistema di posta. Se il ricevente non é il desti=
natario diretto del presente messaggio, sono vietati l'uso, la riproduzio=
ne e la stampa di questo messaggio e di ogni suo allegato, nonché la=
diffusione del loro contenuto a qualsiasi altro soggetto"=0A*****=0A"Thi=
s message and any attachment are confidential and may be privileged or ot=
herwise protected from disclosure. If you are not the intended recipient,=
please contact the sender and delete this message and any attachment fro=
m your system. If you are not the intended recipient you must not use, co=
py or print this message or attachment or disclose the contents to any ot=
her person."

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg