The following tutorial is how to move MySQL database without installing MySQL on a computer that will be used as a server. It can also be done if we want to create an installer database practical applications.
The following example is how to move MySQL database on partition D : so it does not matter if the PC server is damaged so requires reinstall or format the partition C :.
It needs to be prepared is to create a new folder with the name "MYSQLKU" which will be transferred to the partition D :, and later "MYSQLKU" will contain folders and files as follows :
- Folder "bin" contains file : libmySQL.dll, mysql.exe, mysqld.exe, mysqld.map, mysqld.pdb, mysqldump.exe.
- Folder "data " contains folder : "test" , folder "mysql" and other folders according to the database you have. Anyway, just copy all the contents of the folder "test" , "mysql" and other data folders intact.
- Folder "MySQL Datafiles" contain file ibdata1.
- Folders "share" containing folder "english" and its contents . (Anyway, just copy the whole folder "english").
- File "my.ini" change the text settings :
port=3306
basedir="D:/MySQLKU/"
datadir="D:/MySQLKU/Data/"
innodb_data_home_dir="D:/MySQLKU/MySQL Datafiles/" - File "mysql - install.bat" , if none can be created with the notepad and save as it as an All Files named : "mysql - install.bat". This file later as a launcher MySQL database, and executed once, then every time the PC server automatically turns on the MySQL service will run by itself .
The content of the file "mysql - install.bat" :
@echo off
net stop Mysqlku
sc delete Mysqlku
netsh firewall add allowedprogram D:\MYSQLKU\bin\mysqld.exe Mysqlku
D:\MYSQLKU\bin\mysqld.exe --install Mysqlku --defaults-file=D:/MYSQLKU/my.ini
net start Mysqlku - File "mysql - uninstall.bat" . Serves to stop the service MySQL on the server PC. Just like number 6, its contain :
@echo off
net stop Mysqlku
sc delete Mysqlku
After all files and folders have been prepared in the folder "D:/MYSQLKU" , just execute file "mysql - install.bat" as administrator. Then the service has been able to run MySQL .
To create installer database you can use such a simple application Winrar with Archiving options "Create SFX archive" and follow the simple instructions .
Although the total size of the file could reach over 50MB, but after going through the compression process with Winrar its file size will be decreased drastically to less than half.
I give an example of a portable MYSQL you can download . Extract all files in D: partition, run "mysql - install.bat" as administrator. You can acces this database using HeidiSQL. Password of user name root is '123' (without ').
I give an example of a portable MYSQL you can download . Extract all files in D: partition, run "mysql - install.bat" as administrator. You can acces this database using HeidiSQL. Password of user name root is '123' (without ').
Link to download :
0 Response to "Make Portable SQL"
Post a Comment