MySQL server installeren onder Windows met een no_install.zip

Carl on mei 5th 2014

Pak het archief uit op de gewenste locatie. U kunt de server in een shell starten met het volgende commando:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqld
Stop de server in een andere shell met:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqladmin -u root shutdown

Als u de data directorie van MySQL in een andere directorie – en eventueel op een andere schijf – dan de standaard locatie wilt plaatsen, kan dat door de volledige ‘data’ directorie daarheen te verplaatsen. In dat geval moet MySQL geinstrueerd worden waar de gegevensbestanden/databases zich bevinden met behulp van een optie-bestand (my.ini or my.cnf). De server wordt dan gestart met:
shell> {DISK:\LOCATIE[\..\..]\MySQL SERVER DIRECTORIE NAAM}\bin\mysqld --defaults-extra-file={DISK:\PAD NAAR}\[my.ini or my.cnf]
Stop de server als boven aangegeven.

Vaak voorkomende problemen

Maakt u gebruik van InnoDB en u krijgt onderstaande foutmelding, dan kunt u dat eenvoudig verhelpen door ibdata1, ibdata2, and the ib_logfile* bestanden te verwijderen uit de data directorie. Bij herstarten van de MySQL server worden de verwijderde bestanden opnieuw gegenereerd.

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes
InnoDB: than specified in the .cnf file 0 25165824 bytes!
120112 5:16:30 [ERROR] Default storage engine (InnoDB) is not available
120112 5:16:30 [ERROR] Aborting

Als onderstaande foutmelding in het log verschijnt:

140430 22:27:43 [ERROR] [PATH TO......]\bin\mysqld: unknown variable mysql-data-dir=[DIRECTORY TO SPECIFIED DATA DIR]

staat een oude parameter naam in het optiebestand. Vervang ‘mysql-data-dir’ met ‘datadir’ in my.ini/.cnf en herstart de server

Serverinstellingen

De gecompileerde standaard serverinstelling op te vragen kan met onderstaand commando:mysqld --verbose --helpEen overzicht van alle mogelijke server parameters, ga naar: Tuning Server Parameters. De pagina geeft de nodige hulp voor het optimaliseren van de serverinstellingen.

Optiebestand

Voor meer informatie ga naar: Using Option Files

MySQL server starten als een windows service

Gebruik hiervoor een shell/PowerShell met administrator rechten
Voordat u MySQL start als een windows server, zorg ervoor dat deze niet meer actief is. Beeindig MySQL server met onderstaand commando:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqladmin -u root shutdown

De MySQL server als een service installeren
Voor standaard installatie gebruik het commando:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqld --install
bij gebruik van een optiebestand:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqld --install MySQL --defaults-file={DISK:\PAD NAAR OPTIEBESTAND}
Om de dienst handmatig te laten starten vervang –install met –install-manual

De service verwijderen

Om de MySQL server die geinstalleerd is als een service te verwijderen, stop de service als deze actief is met het volgende commando: “NET STOP MySQL”. Gebruik vervolgens de –remove optie om de service te verwijderen:
shell> {DISK:\PAD NAAR MySQL SERVER DIRECTORIE NAAM}\bin\mysqld --remove

Filed in MySQL | Reacties uitgeschakeld

Setting up MySQL server on Windows from a no_install.zip

Carl on mei 1st 2014

Extract the archive to your prefered location. Start the server with:
shell> {DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqld
Stop the server with:
shell> {DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqladmin -u root shutdown

If you want to have MySQL’s data directory in a different location or on another disk, move the directory there. If doing so, you’ll need to use an option file (my.ini or my.cnf), and start the server with:
shell> {DRIVE:\LOCATION[\..\..]\MySQL SERVER DIRECTORY NAME}\bin\mysqld --defaults-extra-file={DRIVE:\PATH TO}\[my.ini or my.cnf]
Stopping server as mentioned above.

Common problems

If you’re using InnoDB and you get an error on startup like below, you can fix it easily by removing the ibdata1, ibdata2, and the ib_logfile* files from the data directory. After restarting you’ll see newly generated files in mysql’s data directory.

InnoDB: Error: log file .\ib_logfile0 is of different size 0 10485760 bytes
InnoDB: than specified in the .cnf file 0 25165824 bytes!
120112 5:16:30 [ERROR] Default storage engine (InnoDB) is not available
120112 5:16:30 [ERROR] Aborting

If you get an error like:

140430 22:27:43 [ERROR] [PATH TO......]\bin\mysqld: unknown variable mysql-data-dir=[DIRECTORY TO SPECIFIED DATA DIR]

You are using an old server parameter name. Replace ‘mysql-data-dir’ with ‘datadir’ in your my.ini/.cnf and start your server again

Server Settings

To see the values that a server will use based on its compiled-in defaults and any option files that it reads, use this command:
mysqld --verbose --help
To get an overview of all server parameters, go to: Tuning Server Parameters. The page will be helpfull with optimizing your server settings.

Option file

Have a look at this page: Using Option Files

Starting MySQL as a service

Before installing MySQL as a Windows service, you should first stop the current server if it is running by using the following command:
shell>{DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqladmin -u root shutdown

Install the MySQL server as a service
To do so use this command:
shell>{DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqld --install
or if you are using an option file:
shell> {DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqld --install MySQL --defaults-file={DRIVE:\PATH TO OPTIONS FILE}
To start the service manual replace --install with --install-manual

Remove service

To remove a server that is installed as a service, first stop it if it is running by executing NET STOP MySQL. Then use the –remove option to remove it:
shell> {DRIVE:\PATH TO MySQL SERVER DIRECTORY NAME}\bin\mysqld --remove

Filed in MySQL @en | Reacties uitgeschakeld