Last active
December 15, 2021 07:45
-
-
Save merolhack/17faf73b0790c6dd3bd2 to your computer and use it in GitHub Desktop.
REHL(CentOs & Oracle Linux): Conexión con SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instalación de FreeTDS y dependencias: | |
yum install freetds freetds-devel -y | |
# Instalación del módulo de PHP: | |
yum --enablerepo=remi install php-mssql -y | |
# Habilitar los siguientes booleanos: | |
setsebool -P httpd_can_network_connect 1 | |
setsebool -P httpd_can_network_connect_db 1 | |
# Reiniciar Apache: | |
service httpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Probar la instalación: | |
tsql -C | |
Compile-time settings (established with the "configure" script) | |
Version: freetds v0.91 | |
freetds.conf directory: /etc | |
MS db-lib source compatibility: yes | |
Sybase binary compatibility: yes | |
Thread safety: yes | |
iconv library: yes | |
TDS version: 4.2 | |
iODBC: no | |
unixodbc: yes | |
SSPI "trusted" logins: no | |
Kerberos: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Agregar conexión con el host: | |
/etc/freetds.conf | |
# HOSTNAME | |
[hostdescripction] | |
host = HOSTNAME | |
port = PORT | |
tds version = 7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Agregar conexión con el host: | |
/etc/odbc.ini | |
[ODBC Data Sources] | |
Caracas = MSSQL Server | |
[Host Description] | |
Driver = /usr/lib64/libtdsodbc.so.0 | |
Description = MSSQL Server | |
Trace = No | |
Server = HOSTNAME | |
Database = DB_NAME | |
Port = PORT | |
TDS_Version = 7.1 | |
[Default] | |
Driver = /usr/lib64/libtdsodbc.so.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Agregar librerías de FreeTDS: | |
/etc/odbcinst.ini | |
# Example driver definitions | |
# Driver from the postgresql-odbc package | |
# Setup from the unixODBC package | |
[PostgreSQL] | |
Description = ODBC for PostgreSQL | |
Driver = /usr/lib/psqlodbc.so | |
Setup = /usr/lib/libodbcpsqlS.so | |
Driver64 = /usr/lib64/psqlodbc.so | |
Setup64 = /usr/lib64/libodbcpsqlS.so | |
FileUsage = 1 | |
# Driver from the mysql-connector-odbc package | |
# Setup from the unixODBC package | |
[MySQL] | |
Description = ODBC for MySQL | |
Driver = /usr/lib/libmyodbc5.so | |
Setup = /usr/lib/libodbcmyS.so | |
Driver64 = /usr/lib64/libmyodbc5.so | |
Setup64 = /usr/lib64/libodbcmyS.so | |
FileUsage = 1 | |
[FreeTDS] | |
Description=ODBC for SQL Server | |
Driver=/usr/lib64/libtdsodbc.so | |
Setup=/usr/lib64/libtdsS.so | |
FileUsage=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conectarse con TSQL: | |
tsql -H HOSTNAME_O_IP -p PUERTO -U USUARIO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conectarse con OSQL: | |
osql -S NOMBRE_DE_CONEXION -U USUARIO -P CONTRASEÑA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice job