Saturday, March 04, 2006

Set up and configure an sql database

Horde comes with an sql script that creates the database and user and such, but it assumes you're running as the sql root user, so that won't work with my hosted server. I'll have to create the database and user with Cpanel and then try to use the rest of the sql script to create the tables.

My host uses Cpanel, which is relatively intuitive. I created a database called "horde", which get's my cpanel userid prepended to it, so it ends up getting called "userid_horde".

Then I created a database userid called "dbuser" and again it gets my cpanel userid prepended, so it's "userid_dbuser".

Then I add the user to the database with all priveleges.

Then I need to delete or comment out the database & userid creation parts of the sql script, leaving only the parts of the script that populate the database. The database and user creation parts are mostly at the beginning, so comment out everything down to the first line that starts with:
CREATE TABLE
in SQL, you comment out the lines by putting double dashes and then a space at the beginning of the line.

The rest of the script is a repetition of creating a table and granting priviliges to horde@localhost. Since this script will get run as a database user, and not as sql root user, comment out all the lines that start with:
GRANT SELECT
There's also a line near the end that needs to be commented out:
FLUSH PRIVILEGES;
That should leave just a bunch of the
CREATE TABLE
and
CREATE INDEX
lines

Then go back to Cpanel, and at the very bottom of the database section (where the databases were created) launch phpMyadmin. Select the userid_horde database(in the left column) and then the SQL tab (across the top). In the lower section, click the browse button, and choose the modified file, then click GO. There should be 8 tables in the database now.




0 Comments:

Post a Comment

<< Home