MySql portable version
Asked Answered
C

3

16

anyone know a portable version of mysql?

I know xampp but it comes with PHP and Apache together

anyone know how to isolate the mysql?

Cataplasm answered 5/12, 2009 at 5:4 Comment(2)
do you mean a standalone version?Andriette
I don't think there is any such thingAndriette
B
45

You can download the MySQL Essentials version and make a few small changes to directories in the my.ini file to use relative paths instead of absolute paths. Then you can run the server directly without having to install or use a Windows service.

  1. Download a MySQL .zip file (instead of an .msi, though you could get the .msi and use 7Zip or Orca to extract the files from it).

  2. Extract the files. At a minimum you need the bin and share directories (actually, in bin, you really only need mysqld.exe as the absolute minimum to run a server).

  3. Edit my.ini to change the basedir and datadir paths to something relative. For example:

    basedir=".."
    datadir="/MySQLdb"
    
  4. If you do not have an existing database, then create one:

    mysqld --bootstrap
    
  5. Run the server (you may need to use the --skip-grant-tables switch to get it running until you have set up your MySQL user):

    mysqld
    
    • To avoid the server being run in the current command-prompt, you can use the following to have it run in its own console which should disappear once it is running:

      start mysqld
      
    • If you get errors, delete the log files (e.g., logs\ib_logfile*) and run it again.

Boisleduc answered 6/12, 2012 at 18:19 Comment(4)
At least mysqld 5.1 seems to use the /data dir by default if you use the zipped version.Lovellalovelock
@Synetech, Why do you say that the files are extractable from the .msi? I've tried extracting with 7zip but the files are not there.Chrominance
There is an issue with --bootstrap on Windows that is resolved by just copying the data folder.Goldofpleasure
About 'bootstrap': running on windows says that is deprecated and invites to use --initializeJujube
F
4

Created a portable configuration at https://sourceforge.net/projects/mysql-server-portable/

You should put your my.cnf or my.ini in a different directory than your data directory.

You will then need to initialize your portable version,

"\mysql-5.7.30-winx64\bin\mysqld" --defaults-file="\mysql-5.7.30-winx64\config\my.ini" --standalone --explicit_defaults_for_timestamp --initialize

then you can start your portable version,

"\mysql-5.7.30-winx64\bin\mysqld" --defaults-file="\mysql-5.7.30-winx64\config\my.ini" --standalone --explicit_defaults_for_timestamp
Feathers answered 3/9, 2020 at 14:6 Comment(0)
C
3

I think not, without counting on XAMPP. You don't have to use PHP or Apache anyway, just run the mysql from the .exe's

Corpora answered 5/12, 2009 at 5:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.