Best practice forum (Archived)

Totara Sync and external database

 
Marta Santamaria
Totara Sync and external database
by Marta Santamaria - Tuesday, 24 December 2013, 1:15 AM
 

Hi all,

I'm a newbie, this is my first post here.

I want to use Totara Sync with external database.

For organisation and user, I can see only "mysqli" option, but for position I can see more options (mysqli, postgresql, oracle...). Why?

When I try to synchronize users with an mysql external database, I get always the same error "Failed to conect to database".

The parms I've entered are:

Database type: mysql

Database name: mydatabasename

Database hostname: www.mydomain.com (other host than totara site)

Database user: myusername

Database password: mypassword

Database table: mytable

What is wrong?

Thanks in advance and Merry Christmas!

Marta

 

? ?
Re: Totara Sync and external database
by ? ? - Thursday, 26 December 2013, 11:00 AM
 

Hi Marta.

When you say you've entered database parameters for name, hostname, user, password, etc, are you being literal that those are the actual settings you are using? Or did you change those so as to not share them with everyone in the forum (good idea by the way). If you are literally using "mydatabasename", "www.mydomain.com", "myusername" then these are only example settings and I am doubtful that those settings represent your environment. Sorry if this is a dumb question :-)

My first step in troubleshooting "Failed to connect to database" errors would be to try to make a connection from outside of Totara, using something like the mysql command line client or another GUI type of database tool. The best way to test would be to do this from the web server where Totara is using. Here is an example using the mysql command line database client (if running server on unix/linux, this can be executed from a terminal or console application). It uses the parameters you posted above:

mysql --host=www.mydomain.com --user=myusername --password=mypassword

If that command is successful you will see a mysql prompt, such as:

mysql>

At which point you can type something like:

mysql> show databases;

Which should show your mydatabasename database.

If it fails, you might see something like "Access denied for myusername" or "unknown mysql server host www.mydomain.com"

 

These basic troubleshooting steps can help to verify if you have your database settings correct or not.

You would also want to verify that your database has a user defined that allows access to the database you need from the IP address of the Totara web server.

I hope these troubleshooting tips aren't too basic but perhaps it will get you going in the right direction.