Koozali.org: home of the SME Server

Obsolete Releases => SME Server 7.x => Topic started by: Dacky on January 23, 2007, 01:38:32 AM

Title: Mysql access for users
Post by: Dacky on January 23, 2007, 01:38:32 AM
I need to setup SME7 to allow over 100 users access to their own mysql database so they can create websites that access a database.  I have the user web page addon which gives each user a "public_html" folder for web site (see http://forums.contribs.org/index.php?topic=33638.0), which is working great.

Ideally, I would like to use a script so I would not need to create 100 databases, but I would if I had to.  I just need to know how to give each person their own database.

Thanks.
Title: Re: Mysql access for users
Post by: cactus on January 23, 2007, 09:38:21 AM
Quote from: "Dacky"
I need to setup SME7 to allow over 100 users access to their own mysql database so they can create websites that access a database.  I have the user web page addon which gives each user a "public_html" folder for web site (see http://forums.contribs.org/index.php?topic=33638.0), which is working great.

Ideally, I would like to use a script so I would not need to create 100 databases, but I would if I had to.  I just need to know how to give each person their own database.

Thanks.

You can create a database two ways, the first one is from the command line:
Code: [Select]
mysqladmin create databasename
or login to mysql and create a database there:
Code: [Select]
mysql
create database databasename

To grant a user privileges on a database:
Code: [Select]
mysql
grant all privileges on databasename.* to 'username'@'host.domain' identified by 'password';
flush privileges;

All this is described very good and detailed in the mysql manual (http://dev.mysql.com/doc/refman/4.1/en/index.html) which you can find on the mysql website (http://www.mysql.com).