Local server solution like XAMPP, WAMP or Laragon doesn't provide MSSQL server rdbms out of the box, so the developers should install it separately and manually. Good thing if you are using Laradock all along, MSSQL is already included and easy to setup as easy as running MySQL and PostgreSQL in Laradock. Or Alternatively, you can run only MSSQL in Laradock and let's the project from other local server access it through localhost. Here I will demonstrate how to run MSSQL + Adminer as the management UI in Laradock.
RunningMSSQL Server
Service
We will try to make sure themssql
service is running well before running the adminer. So to run mssql service, here is the command:
docker-compose up -d mssql
To check if it's running or not, usedocker-compose ps
:
Name Command State Ports----------------------------------------------------------------------------------------------------laradock_mssql_1 /opt/mssql/bin/nonroot_msg ... Up 0.0.0.0:1433->1433/tcp,:::1433->1433/tcp
And when we check the resource usage usingdocker stats
, here is the result:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS1bab3ac14e94 laradock_mssql_1 1.45% 622.3MiB / 6.043GiB 10.06% 1.17kB / 0B 0B / 0B 138
RunningAdminer
Service
Before build and run theadminer
service, make these value set in your.env
:
ADM_INSTALL_MSSQL=truePHP_FPM_INSTALL_MSSQL=trueWORKSPACE_INSTALL_MSSQL=true
After that, then we can start build and run the service by this command:
docker-compose up -d adminer
Theadminer
service depends onphp-fpm
service, while thephp-fpm
service depends onworkspace
service. So these service will be automatically built run before theadminer
.
Thedocker-compose ps
result with the current services:
Name Command State Ports---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------laradock_adminer_1 entrypoint.sh docker-php-e ... Up 0.0.0.0:8081->8080/tcp,:::8081->8080/tcplaradock_docker-in-docker_1 dockerd-entrypoint.sh Up 2375/tcp, 2376/tcplaradock_mssql_1 /opt/mssql/bin/nonroot_msg ... Up 0.0.0.0:1433->1433/tcp,:::1433->1433/tcplaradock_php-fpm_1 docker-php-entrypoint php-fpm Up 9000/tcp, 0.0.0.0:9003->9003/tcp,:::9003->9003/tcplaradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp,:::2222->22/tcp, 0.0.0.0:3000->3000/tcp,:::3000->3000/tcp, 0.0.0.0:3001->3001/tcp,:::3001->3001/tcp, 0.0.0.0:4200->4200/tcp,:::4200->4200/tcp, 0.0.0.0:8001->8000/tcp,:::8001->8000/tcp, 0.0.0.0:8080->8080/tcp,:::8080->8080/tcp
Thedocker stats
result with the current containers:
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
2cfc8ac64e92 laradock_adminer_1 0.00% 6.605MiB / 6.043GiB 0.11% 1.52kB / 0B 0B / 0B 1
e8e5d86c2efe laradock_php-fpm_1 0.00% 17.38MiB / 6.043GiB 0.28% 796B / 0B 0B / 0B 3
06d7bd6073a6 laradock_workspace_1 0.00% 10MiB / 6.043GiB 0.16% 2.04kB / 0B 0B / 0B 6
1056353f4d06 laradock_docker-in-docker_1 2.55% 30.45MiB / 6.043GiB 0.49% 796B / 0B 0B / 0B 29
1bab3ac14e94 laradock_mssql_1 1.62% 673.8MiB / 6.043GiB 10.89% 286kB / 15.4kB 0B / 0B 149
Accessing MSSQL Server using Adminer
The adminer login page can be accessed as default athttp://localhost:8081 or the port number defined inADM_PORT
. Here is the login page looks like:
We can start to access the mssql through this login page.
- For the system, use
MS SQL
(in my adminer version, the mssql was still in beta). - The server is
mssql
, - the username is
sa
, - the password is what defined in
MSSQL_PASSWORD
, and - the database is what defined in
MSSQL_DATABASE
.
After filling all those, hit that Login button and you should redirected to adminer database management interface.
Top comments(1)
For further actions, you may consider blocking this person and/orreporting abuse