Koozali.org: home of the SME Server

Mysql access for users

Dacky

Mysql access for users
« 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.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Mysql access for users
« Reply #1 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 which you can find on the mysql website.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)