MySql installation
Posted by: ermWamp (144.162.193.---)
Date: July 01, 2013 05:55PM

I installed MySql from microsoft into a directory called C:\wamp\bin\mysql\mysql5.6.12 This has created some issues since the file structure is different. For instance, the exe dir is C:\wamp\bin\mysql\MySQL Server 5.6

What configuration files do I need to change to get this install of MySql to work with WAMP? What should the changes look like (dir paths etc).

Thank you

Options: ReplyQuote
Re: MySql installation
Posted by: RiggsFolly (---.as13285.net)
Date: July 01, 2013 06:15PM

Clarification please!

Did you install MySQL from Oracle

or

Microsoft Sql Server from Microsoft?

Options: ReplyQuote
Re: MySql installation
Posted by: ermWamp (144.162.193.---)
Date: July 01, 2013 06:49PM

MySql from Oracle. Sorry about that. The Community edition from Oracle.

Options: ReplyQuote
Re: MySql installation
Posted by: RiggsFolly (---.as13285.net)
Date: July 01, 2013 08:10PM

Here is my notes on doing it. Version is different of course but the process should be similiar.



HowTo: Install a new version of MySQL into wamp and migrate your data properly.


Please read the whole post before starting this process. Mistakes can cause untold hassle.

Also take a copy of your WHOLE C:\WAMP folder so you can replace it if necessary if something goes wrong.

A backup of your databases is also a good idea.


Assumption: That you are using the default wamp config where all your databses are stored in the mysql.x.y.x\data\ folder.
If thats the case no backup of your databases is necessary, but it would not hurt, just in case.
This should also work if you are using innodb databases, stored in the mysql.x.y.x\data\ folder.


This will take your complete MySQL environment, including users, passwords and privilages so they do not need to be re-created on the new release.


I have tried to keep it simple here using c:\wamp, but you may have wamp on another drive, just change c: to whatever you use.

Before you start read the upgrade notes on the mysql.com site for information on anything you may have to do to your existing data before you start the upgrade.
There should be a page devoted to major upgrades, you will have to read between the lines if you are doing a minor upgrade.

A glance at the changelog is also a good idea as it will give you a clue as to what has changed and how that may effect your SQL and or data.


So here is the process:

1. Download the ZIP version of the mysql you want to run ( not the msi installer, only because I dont know what it may do or assume when it installs )
Suggested source [www.mysql.com]

2. From wamp manager, Stop all services.

3. Go to c:\wamp\bin\mysql\ and create a new folder named appropriately i.e mysql5.5.28

4. Unzip the mysql and copy the contents of the MySQL folder into your newly created folder. Make sure the directory levels are the same as your existing MySQL folder.

5. Copy all the contents of your previous mysql\mysql5.5.10\data folder into the new data folder under your newly created version folder.
Thats EVERYTHING not just your databases, including the ibdata1, ib_logfile0, ib_logfile1 and all the mysql-bin.0000xx files.
We are going to use the recommended mysql-upgrade tool so this is ok to do.
This will also ensure that you keep all your Users and password and granted privilages intact when the upgrade is complete.

6. Copy c:\wamp\bin\mysql\mysql5.5.10\wampserver.conf to c:\wamp\bin\mysql\mysql5.5.28\wampserver.conf
All the folders in here are relative to where this file lives, so normally nothing need changing in here.

7. RIGHT CLICK wampmanager -> refresh
This will make wamp manager find your new version.
Check this by Left click wampmanager -> MySQL -> Versions Your new version should be available in the list.

8. From wamp manager -> MySQL -> Version click on your new version.
Normally you would have to uninstall the old wampmysql service and re-install the new wampmysql service, but wamp takes care of all that for you by just clicking the new version number.
This should also start the new mysql service, so now the new mysql is running.
BUT DONT DO ANYTHING YET!!!

9. Launch a command window ( using Run As Administrator ).
CD into c:\wamp\bin\mysql\mysql5.5.28\bin folder ( the new releases bin folder ).
And run
mysql_upgrade -u[your MySQL admin userid] -p > upgrade_results.txt

It will ask you for the password for the admin user you provided on the -u parameter.
enter the password.

Wait while it runs, If you have very large databases this may take some time but normally it will take anything from a few seconds to a minute or two.
This will look at your databases and do any upgrades that are required and also any upgrades/maintenace of the mysql database that MySQL uses internally.
Thats the tables that contain your userids and password and privilages and other things.

10. Check for errors in the upgrade_results.txt file, fix if there are any.
You can repeat this as often as you like, just refresh the data from the old versions data folder each time.

11. LEFT Click wamp manager -> MySQL -> Service -> Stop Service.
Then again and Start Service. This will load the changed mysql database with any new/changed config info.

12. At this point assuming you are staying on the newly installed version of MySQL its a good idea to run:
wampmanager -> MySQL -> MySQL Console
and run a
> reset master;

To reset the log files.



Thats it your are ready to go and all your userid's and data are converted to the new MySQL version.

TROUBLESHOOTING

The Beauty of WAMP
If you find you have a problem with one of your databases you can just switch the MySQL Version back to the old version, fix the databases using MySQL Workbench or phpMyAdmin.
The copy all the contents of the data folder into your new release and re-run the mysql_upgrade.exe as many times as it takes to fix your issues.

And of course if it all goes bad in a big way, you can switch the MySQL version back to whatever you were using before and all your data is still there UNTOUCHED.


Now this may seem obvious but I am going so say it anyway:
1. If everything goes smoothly you do have to remember that you now have 2 versions of the same database(s) that are being maintained SEPERATELY.
2. It is not possible to use this process to DOWNGRADE your databases!!!

Options: ReplyQuote


Sorry, only registered users may post in this forum.