MySQL Forums
Forum List  »  General

using mysqld_multi.. questions about config
Posted by: todd lamothe
Date: April 18, 2005 06:47AM

I am trying to get more than one instance of the server running.
Up to this point, mysql has been running a single instance, on mac os x, running from the "/Library/MySQL/bin" directory; data is served from /Library/MySQL/data. It works fine.

I would like to run another instance (let's call it 'mysqld2', d2 for short) and have d2 serve off a repository folder (/usr/local/repository/sqldata).

When I start mysqld_multi I get errors.

I am not certain what the background configuration of my 'user' for mysqld1 and mysqld2 should be. Do these 'users' have to be a unix user? Or do I just create a new user in mysql user table? If they are just mysql users, what rights should they have? And how far-reaching -- Global?

I am uncertain what the docs mean by giving the 'user' for each mysqld instance read/write access to the particular folders where the dbs live. From a unix standpoint, what does that mean -- How should I configure my repository folders? (i.e., "who" should be the owner). I don't really want to configure my unix folders to be owned by a unique user.

I am running using 'localhost' but recently added a second hostname so I could use apache2 and have more than one local host so I can test more sites at once. My 'second' localhost is called 'secondlocalhost'. If possible, I'd like to have the second server instance of mysql use secondlocalhost instead of the first, localhost.

Even though I'm unclear about user names, where they go and how I define ownership, I would be okay with having one user be in control of db1 and db2 (server instance).

Here's some of the settings from my.cnf (I've only copied what I think is applicable, the rest of the stuff in my.cnf is standard otherwise):
*errors from mysqld_multi follow the my.cnf excerpt*

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
myisam_sort_buffer_size = 8M

[mysqld_multi]
mysqld = /Library/MySQL/bin/mysqld_safe
mysqladmin = /Library/MySQL/bin/mysqladmin
user = multi_admin
password = ma_pwd

[mysqld1]
socket = /tmp/mysql.sock2
port = 3307
pid-file = /Library/MySQL/var/localhost.pid2
# pid-file was originally eg: /usr/local/mysql/var2/hostname.pid2
datadir = /Library/MySQL/data
language = /Library/MySQL/share/mysql/english
user = lois

[mysqld3]
socket = /tmp/mysql.sock3
port = 3308
pid-file = /Library/MySQL/var/secondlocalhost.pid3
datadir = /usr/local/repos/mysql
language = /Library/MySQL/share/mysql/english
user = clark

Here's the error I get when I start mysqld_multi:

WARNING: Log file disabled. Maybe directory/file isn't writable?
mysqld_multi log file version 2.7; run: Mon Apr 18 00:31:59 2005

Starting MySQL servers
cat: /Library/MySQL/var/localhost.pid2: Permission denied
rm: /Library/MySQL/var/localhost.pid2: Permission denied
Fatal error: Can't remove the pid file: /Library/MySQL/var/localhost.pid2
/Library/MySQL/bin/mysqld_safe: line 275: /Library/MySQL/data/mini.local.err: Permission denied
Please remove it manually and start /Library/MySQL/bin/mysqld_safe again
mysqld daemon not started

$ Starting mysqld daemon with databases from /usr/local/repos/mysql
/Library/MySQL/bin/mysqld_safe: line 302: /usr/local/repos/mysql/mini.local.err: Permission denied
/Library/MySQL/bin/mysqld_safe: line 1: /usr/local/repos/mysql/mini.local.err: Permission denied
STOPPING server from pid file /Library/MySQL/var/secondlocalhost.pid3
tee: /usr/local/repos/mysql/mini.local.err: Permission denied
050418 00:32:00 mysqld ended
tee: /usr/local/repos/mysql/mini.local.err: Permission denied

*** can anyone help?? ***

Thanks!
-Todd
running:
Mac OS X 10.3.8 running on a cute mini : )
Apache/2.0.52 (Unix)
PHP/4.3.9 DAV/2
mysql Ver 12.22 Distrib 4.0.21, for apple-darwin7.5.0 (powerpc)

Options: ReplyQuote


Subject
Written By
Posted
using mysqld_multi.. questions about config
April 18, 2005 06:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.