Monday, March 24, 2008

How to configure MySQL backend in Plastic SCM 2.0

It's very simple to set up, you only need to create (or edit) a file named 'db.conf' at the server installation directory.

Its content must be like the following:


<DbConfig>

<ProviderName>mysql</ProviderName>

<ConnectionString>
Server=_SERVER_;User ID=_USER_;
Password=_PASSWORD_;Database={0};Pooling=true
</ConnectionString>

<DatabasePath></DatabasePath>

</DbConfig>

replacing the parameters _SERVER_, _USER_ and _PASSWORD_ with the appropiate ones according to the server configuration that you want to use. Thus, a valid 'db.conf' file in our development environment would be:


<DbConfig>

<ProviderName>mysql</ProviderName>

<ConnectionString>
Server=venus;UserID=myuser;
Password=mypwd;Database={0};Pooling=true
</ConnectionString>

<DatabasePath></DatabasePath>

</DbConfig>

Finally, we must set the mysql configuration parameter max_allowed_packet to support up to 10MB. If you require more information about how configure this parameter, you can take a look at this article.

7 comments:

Carlos Eduardo said...

Hi!!!
Firstable should I create the database in the server???
Thanks.

pablo said...

No, just configure the db.conf file, then start up the plastic server and the databases will be automatically created.

Check loader.log.txt for possible connection errors (mysql setup, you know, privileges and stuff)

Carlos Eduardo said...

Hello again
I'm following all the steps but I can't see the schema (database)in the Mysql Administrator. How can I see if the database has been created?

Carlos Eduardo said...

The server administrator has created an user: plasticscm, and it's what I'm using. Should it be the root user?

pablo said...

Hi Carlos,

You've to configure the connection string first.

Once it is configured, you can connect to mysql using the same user you've specified for the conn str.

You should see at least three new databases: workspaces, repositories and rep_1

You can list them using "show databases;" from the MySQL command line client.

But, if they're not created, there must be a problem with the server or the connstr... You'll see it in loader.log.txt file at your plastic server's location.

Feel free to contact support@codicesoftware.com if you feel you need more help.

Carlos Eduardo said...

Hi
But the user that I've specified for the connection string, Must be firstable created on MySQL Administrator??? or it will be created at start up of application??

pablo said...

Hi Carlos,

No, you should create the user first. Plastic won't create the user.

Hope it helps