nice share mr. chris




Pada Minggu, 22 Mei 2016 1:30, Chris Calender <chris.calender@mariadb.com> menulis:


Hello,

I have a custom .bat script I use on Windows which I use to upgrade both
MariaDB and MySQL instances.  It's not a supported 'tool' by any means,
but works great for me in my Windows environment.

You'll see 9 variables at the beginning which you will need to set for
your environment, like basedir, datadir, config file, user, pass, port,
service name, the download link, and download directory.

I've attached it as a .txt file.  Just edit those 9 variables, rename it
to upgrade.bat, and invoke it from the command line:

C:/location/of/file> upgrade.bat

Once you have it set up for you instance, then future upgrades really
only require you changing your download link.

Beware I have all of the gnuwin32 utils, which this script uses, so you
would either need those (e.g., wget, cp, mv, mkdir, unzip), or you would
need to convert those commands to their native Windows equivalents.  I
also mention any caveats at the top of the file.

In a nutshell, it downloads and unzips the package you specify.  Then
stops the service, copies out the old, replaces with the new, copies in
existing datadir and config file, and then restarts the service.  At the
end, it runs mysql_upgrade, and then displays the new version number for
your reference.

Here is some sample output from an upgrade I just ran using it last
night (from MariaDB 10.1.13 to 10.1.14).  You can see at the end it took
~6 minutes, most of which was the download and extraction:

...
  inflating: C:\mysql/ma
  inflating: C:\mysql/ma

+-----------------+
| version()      |
+-----------------+
| 10.1.13-MariaDB |
+-----------------+

net stop "maria101"
The maria101 service is stopping.
The maria101 service was stopped successfully.

rm -rf "C:\mysql\mariadb-10.1.14-winx64\data\*"

cp -r "C:\Program Files\MariaDB 10.1\data\*"
"C:\mysql\mariadb-10.1.14-winx64\data"

cp "C:\Program Files\MariaDB 10.1\data\my.ini"
"C:\mysql\mariadb-10.1.14-winx64\data"

mkdir "C:\mysql\maria101-backup\"

mv "C:\Program Files\MariaDB 10.1\*" "C:\mysql/maria101-backup/"

mv "C:\mysql\mariadb-10.1.14-winx64\*" "C:\Program Files\MariaDB 10.1/"

net start "maria101"
The maria101 service is starting.
The maria101 service was started successfully.

mysql_upgrade.exe" -uroot -pxxx -P3316
Phase 1/6: Checking and upgrading mysql database
Processing databases
mysql
mysql.column_stats                                OK
....
test
test.mem1                                          OK
test.tbl_name                                      OK
Phase 6/6: Running 'FLUSH PRIVILEGES'
OK

+-----------------+
| version()      |
+-----------------+
| 10.1.14-MariaDB |
+-----------------+

start=20:40:40.14
end = 20:46:59.55


Hope this helps.

Best wishes,
Chris


--
Chris Calender, M.S., Principal Support Engineer
MariaDB Corporation



> On 5/13/2016 7:20 PM, Irwanto wrote:
>> hi,
>> i have 5-15 pc as server using mariadb.
>> i always copy and update latest release one by one to server.
>> is there any tool to download, stop service and extract update my
>> mariadb in windows.
>> maybe some one know it
>>
>> thanks b4
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~maria-discuss
>> Post to    : maria-discuss@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~maria-discuss
>> More help  : https://help.launchpad.net/ListHelp