I may have installed the wrong version of the TDS driver
I have now downloaded the 5.4nts version and I am now getting the following error, which is very odd
I may have installed the wrong version of the TDS driver
I have now downloaded the 5.4nts version and I am now getting the following error, which is very odd
It seems that Moodle didn't install correctly. Is it a new Moodle installation? If so, drop and re-create the database. Empty out the Moodledata folder and then start the Moodle installation again. It's the safest option, rather than trying to fix a half-broken installation.
Hi
Moodle installed correctly and has been running for 4 months and works perfectly
It is only when I switch the PHP.ini to use the TDS driver that this happens. When I switch back its fine
Cheers
Log files:
sqlsrv_connect: message = [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections.
I am using the same DB connection string from my config.php in the FreetDS.conf
I have tested with and without $CFG->dblibrary = 'native'; in config
Here is my full config for FreeTDS driver
$CFG->dbtype = 'mssql';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'myserver.local';
$CFG->dbname = 'mydbname';
$CFG->dbuser = 'mydbuser';
$CFG->dbpass = 'mydbpassword';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);
Here is my FreeTDS.conf which is stored in the root of the C:/ drive and also in the root of my PHP Dir
[global]
host = myserver.locall
port = 1433
client charset = UTF-8
tds version = 9.0
text size = 20971520
I am using TDS 0.9 so I assume the TDS version would 9.0 as the Moodle docs suggest TDS version 8.0 when using version 0.8
Thanks
OK so mysql extension was enabled which was messing it up
But now everything loads and seems fine until I go to resore and course made from an installation using the sqlsrvr drivers and now it complains that
mssqlnative extension not installed
But if I back up a course and restore from within the same install everything works fine
Am I right in assuming that one cannot swap to the freeTDS driver, but only undertake a new install?
Cheers
OK I still have a an issue but I have got it working
Here are the installation instructions
Installation instructions
1. Copy php_dblib to C:\php-5.4.29-VC9\ext (make sure this is the right PHP directory
2. Add the following extensions in the php.ini:
extension=php_dblib.dll
comment the following extensions:
;extension=php_sqlsrv_54_nts.dll
;extension=php_mysql.dll
[PHP_MYSQLI]
;extension=php_mysqli.dll
3. Change the moodle.config, making sure you change the SQL to suit your installation
$CFG->dbtype = 'mssql';
//$CFG->dblibrary = 'native';
$CFG->dbhost = 'yourdbserver';
$CFG->dbname = 'youdbname';
$CFG->dbuser = 'yourdbuser';
$CFG->dbpass = 'youdbpassword';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array (
'dbpersist' => 0,
'dbsocket' => 0,
);
4. Add the freetds.conf to C:/ root, making sure you change the sql server to suit your installation
[global]
host = sameasmoodleconfigl
port = 1433
client charset = UTF-8
tds version = 8.0
text size = 20971520
5. Change the sql driver to MSSQL in Moodle; Site administration > Plugins > Enrolments >External Database > Database Driver
6. Restart IIS
I still have one issue, if I run the security report it appears to be still trying to use the MSSQL native driver and I am not sure why
What happens when you use:
tds version = 7.3
instead of 9.0?
http://www.freetds.org/userguide/choosingtdsprotocol.htm says: "... when Microsoft started releasing official specs of the protocol, it became obvious that the TDS versions that FreeTDS had labeled 8.0 and 9.0 were actually versions 7.1 and 7.2 respectively. For compatibility reasons version 8.0 is still handled by FreeTDS but you should avoid using it as it could be removed in a future version of FreeTDS or it could clash with a future SQL server version."
You could also try 7.4, but in http://lists.ibiblio.org/pipermail/freetds/2015q2/029439.html Frediano (who is one of the FreeTDS developers) says: "7.3 is fine. master support 7.4 but there are no improvements (support some session recovery which are not implemented anyway)".
In that message he explicitly states that "sql 2012 and sql 2014 use same protocol (7.4)".
So, as I understand that, you should use "tds version = 7.3" when connecting to any version of MS SQL Server from 2008 and up.
If I change the freetds.conf to anything other than
tds version = 8.0
it fails with a weird error and mostly empty screen
I am actually using version 0.91.102 NTS version as I am using PHP.5.4
Great info
What's that "weird error"?
Does PHPInfo() contain a "MSSQL" section when you use "tds version = 7.3"?
Also, have you set the TDSVER environment variable? If so, what version does it reflect?
http://www.freetds.org/userguide/envvar.htm
Thanks for your help on this
The weird error is set out above, its a weird upgrade error
However when it works, everything works except for the security overview, the rest of the sites works great
I didn't set the environmental variable because I just left the freetds.conf in the C:/
So now everything appears to be good, apart from oddly the security overview report which to be honest is not that important. I am thinking it might be a bug insofar as a bug that presents itself when one changes a current installation from the standard PHP "sqlsvr" driver to the freeTDS one
Albert