0
Does anyone know how to distribute the application and mysql database together?
I’m using Innosetup, I can even install mysql, start the service but when I connect it gives error saying I can not connect. See the code of the Internet:
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "ServerSisEscola"
#define MyAppVersion "1.0"
#define MyAppPublisher "ServerSisEscola"
#define MyAppURL "http://"
#define MyAppExeName "MyProg.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{6AF944A0-16EF-4099-8AA7-6FC0F023D9E5}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\{#MyAppName}
DisableDirPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: brazilianportuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
[Files]
Source: D:\tcc Sis_escola\Sistema_Escola\Sistema_Escola\bin\Debug\Banco\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
Source: D:\tcc Sis_escola\Sistema_Escola\Sistema_Escola\bin\Debug\Banco\IniciarServico.bat; DestDir: {app}; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
[Tasks]
Name: ServidorSisEscola; Description: Servidor Sistema Escola; Flags: exclusive
[Run]
Filename: {app}\IniciarServico.bat; Flags: waituntilidle
After that it Opens a . bat to configure:
cd bin
mysqld --install Mysql_SistemaEscola --defaults-file="C:\ServerSisEscola\my.ini")
net start Mysql_SistemaEscola
cd bin
mysql -u root -p 3308 -h localhost SistemaEscola.sql <SistemaEscola.sql
I copied the entire mysql folder to the directory of my application according this tutorial but it didn’t work, I can’t connect.
Puts the exact Mysql error in your question which makes it easier to find out what the problem is.
– André Ribeiro
This is the error ERROR 2003 (HY000): Can’t connect to Mysql server on 'localhost' (10061)
– Fabrício Mendes
You changed the Mysql port to
3308
? The standard is3306
.– André Ribeiro
Right. I switched to 3306 and contained the error. I forgot to mention this
– Fabrício Mendes
Are you sure that Mysql has been started? Take a look at the events log, something may have gone wrong. Please put your file
my.ini
.– Vinícius Gobbo A. de Oliveira
Another thing I realized now:
-p
is the parameter to ask for the password to be entered. To specify the port you have to use-P [PORTA]
(P maíusculo) or--port [PORTA]
– André Ribeiro
hello Vinicius Gobbo A. de Oliveira, thank you very much for the return. It does not fit all file. # The TCP/IP Port the Mysql Server will Listen on port=3306 #Path to installation directory. All paths are usually resolved relative to this. basedir="C: Serversisescola bin" #Path to the database root datadir="C: Serversisescola Data"
– Fabrício Mendes