Installing a new release of WAMPServer
Posted by: RiggsFolly (---.as13285.net)
Date: May 04, 2014 06:06PM

Before installing the new release.

Warning: This is ONLY valid to switch from an old version of Wampserver 2.x to Wampserver 3.
If you already have Wampserver 3 and you want to change version, there are Wampserver 3 updates.
If you want to add Apache, PHP, MySQL or MariaDB versions to your current version of Wampserver 3, there are addons.
All this is available on Sourceforge, but much better organized on https://wampserver.aviatechno.net/

If, from Wampserver 2.5, you want to switch to WampServer 3, read WAMPserver 3 - All you need to know where you will see that you can upgrade WampServer 2.5 to WampServer 3.0.3 directly in situ and then apply the WampServer 3.0.6 update over WampServer 3.0.3 without any problems and without changing your active versions of Apache, PHP and MySQL, nor changing your existing VirtualHost.

This is not a simple click and go process. There are many things that can trip you up. However it is quite achievable with a bit of common sense!
Dont start this process if you only have 20 minutes to get it done, that should be all you need, but depending on your skill level and the number of releases of all 3 pieces of software you are skipping it may take longer.

This whole process is based upon the fact that a WAMPServer install is basically just a copy of files onto your disk, with a little file tailoring so it knows what disk you installed on. The only things that are linked to the folder you install it into are the installation of the three windows services 'wampapache', 'wampmysql' and 'wampmariadb'. So if we remove those, and there is a menu option to do this on wampmanager, then your original install is basically removed.

First Backup all your databases in Format=SQL, thats your databases and not the ones that come with MySQL. Save the backups somewhere safe and readily available.

MySQL's databases are 'mysql', 'information_schema' and 'performance_schema' dont back these up, unless you know what you are doing and you know you need them.
Also you dont need the database called 'test' unless you used it for something you want to keep.

If your databases are small to medium sized you can use can use phpMyAdmin to do the backups.
If they are large and phpMyAdmin fails to back them up ( normally due to a PHP max_runtime limit ) you will have to backup using the mysqldump.exe. see [dev.mysql.com] for help on that.

Now if all your sites connect to their databases using 'localhost','root' and '' ( a blank password) there is nothing else to do. ( NOT A GOOD IDEA BY THE WAY )
If you set a root password and use ('localhost','root' and 'some_password_you_set' ) you just need to remember that password so you can recreate it on the new version of MySQL. ( ALSO NOT A GOOD IDEA )
However if you have done things properly and created specific MySQL users and passwords for each of your site(s) databases you are going to have to go and find out what these userids and passwords are and make a note so you can recreate them after you have restored your databses on the new version of MySQL.
Alternatively you can use phpMyAdmin to export each of your Userids as SQL statements, save these and then re-apply them to the new version of MySQL.


So now before we install the new WAMP Server

There are only 2 things that are actually installed by a WampServer installation and those are the Apache and MySQL Services.
So lets remove these 2 services.

Start WampServer
wampmanager -> Stop all Services
wampmanager -> MySQL -> Service -> Remove service
wampmanager -> Apache -> Service -> Remove service

Now stop wampmanager.
rightclick wampmanager -> Exit

Rename your wamp folder to something eg 'wamp_old'. This is your backup!

Now you can install the new version of WAMP Server, so lets do that.
Download and install the new WAMP, you can install onto any drive C;, D; E; etc, install it into the root of the drive i.e. C:\wamp, but dont install into C:\Program Files\

Check your new install works by:
Starting WAMP if you didnt start it automatically out of the install.
1. Check the wampmanager icon in the system tray goes GREEN.
2. Run : wampmanager -> localhost
3. Click on the phpMyAdmin link on this page, and check this works also.
WampServer initially load to a login page. Remember on a new install the username = root and the password is BLANK.

If you get problem with either, remember this new install does not have any of the config tailoring that you may have done to the previous release. So now would be the time to compare you old config's with the new ones and bring over anything from the old config that you need again on the new install.
Also remember you are upgrading Apache, MySQL and PHP. and parameters for all 3 of these may have changed / been added to/ or have been removed!!!!
So dont just copy them over from your old wamp to the new. THERE BE DRAGONS !!!
This is also why we dont delete the old wamp folder, until we are sure the new install is working properly.

If you are using Apache 2.4.?
Now it a good time to read through the STICKY post [forum.wampserver.com]

Your php.ini used by Apache
(use wampmanager -> PHP -> php.ini to access this ) it actually lives in \wamp\bin\apache\apachex.y.z\bin\php.ini but dont edit it directly use the wampmanager menu link

Your php.ini used by PHP CLI
if you actually use the PHP CLI feature ( edit \wamp\bin\php\phpx.y.z\php.ini directly )

Compare your old and new versions, remember things may have changed, extentions added into the core of php and are therefore not required as extensions anymore etc.

Your my.ini.
Again things change, parameters get deprecate, new ones are created etc.
For example if you are using INNODB databases you will have to activate the innodb parameters which are by default commented out.
You may well have to check the mysql website for some information, they supply a How to upgrade page for all releases.
This is just an example [dev.mysql.com]

Once this is all sorted out you can look at restoring your MySQL users and your databases to the new version of MySQL.
Also remember if you are coming from a VERY OLD version of MySQL, this restore process may not be totally straight forward, and you should expect to have to tweek a few things when you find that the new version of MySQL does not like your old data. This is fairly unusual, but may happen. Again dont try and do this 10 minutes before you have to give a presentation using the new WampServer.

Bringing your websites forward to the new release
Now you can just copy your \wamp_old\www\* folders to the new \wamp\www\

Bringing your Virtual Hosts forward to the new release
At this point if you use Virtual Hosts you can bring over your extras\https-vhost.conf from the folder containing the old version of Apache to the new folder containing your new version of Apache.
Remember the instructions in this file may need tailoring to the new release of Apache.
At a minimum, remember to check for the 'Allow from', 'Require' changes, mentioned earlier, and uncomment the 'Include conf/extra/httpd-vhosts.conf' line from your new httpd.conf file.

If it all goes horribly wrong and you need to go back to the previous version you had running.

We can go back to your original wamp version by doing:

Start the new WAMPServer, and remove the MySQL and Apache services.
wampmanager -> Stop all services
wampmanager -> MySQL -> Service -> Remove service
wampmanager -> Apache -> Service -> Remove service
wampmanager -> MariaDB -> Service -> Remove service
Now stop wampmanager.
rightclick wampmanager -> Exit

rename the current \wamp folder eg. \wamp_new ( or if you are totally giving up you can delete this one and start from scratch again another day. )
rename the \wamp_old folder back to '\wamp'

Start wampmanager, the existing icon on your desktop should still work, and Install the MySQL and Apache services.
wampmanager -> MySQL -> Service -> Install service
wampmanager -> Apache -> Service -> Install service

You should be back to where you were before starting this process.
Remember to clear you browser cache ( CTRL + F5 ) to ensure you dont get funnies happening once you switch installations.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 13 time(s). Last edit at 06/08/2023 11:54AM by Otomatic.

Options: ReplyQuote
Re-create root user deleted by mistake
Posted by: Otomatic (Moderator)
Date: January 11, 2021 05:45PM

-- Re-create root user deleted by mistake
and/or
-- Reset a forgotten root password
and/or
-- Reassign all privileges to root

If you have set a password for the root user, but you have forgotten it, or you accidentally deleted all with root privileges, you can choose a new password and re-allocate privileges the following procedure in Windows:
For MySQL 8, depending on the version, this procedure may not work. In this case, see the procedure indicated at the bottom of the page.

The Windows session must be administrator and Wampserver started as administrator.

1. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

2. Edit the my.ini file
wampmanager -> MySQL -> my.ini

3. Find the [wampmysqld] or [wampmysqld64] section in the ini file
Add or uncomment (without ; at the beginning) this line directly after the section [wampmysqld] or [wampmysqld64]
For MySQL before 8.0.0
skip-grant-tables
For MySQL after 8.0.0 two lines to add
skip-grant-tables
shared-memory=on
3a. Don't forget to save the file that has just been modified.

4. Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service

5. Open the MySQL console
wampmanager -> MySQL -> MySQL Console
Enter key on request Password
to get, after a few lines of text, the mysql> command prompt

6. Recreate root user if deleted by mistake. Type the following command at the mysql> prompt
Don't do if root hadn't been deleted.
INSERT INTO mysql.user (User, Host, ssl_cipher, x509_issuer, x509_subject)
VALUES('root','localhost','','',''),
('root','127.0.0.1','','',''),
('root','::1','','','');
If you recreate the root user, points 7a. and 7b. are to be done imperatively.

7a. Now we are going to reset the password for the root user, of course this could be used to reset any users password.

enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.
--- For MySQL versions prior 5.7.0
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE user='root';
FLUSH PRIVILEGES;
--- For MySQL versions after 5.7.0 and before 8.0.0
UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass'), password_expired = 'N' WHERE User = 'root';
FLUSH PRIVILEGES;
 
--- For MySQL versions after 8.0.14
--- For MySQL before 8.0.15 see MYSQL 8.0.0 below
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
ALTER USER IF EXISTS 'root'@'127.0.0.1' IDENTIFIED BY 'MyNewPass';
ALTER USER IF EXISTS 'root'@'::1' IDENTIFIED BY 'MyNewPass';
 

7b. Reassign all privileges to root Only if root had been deleted :
- enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql. (Given the length of the first line, it is necessary to perform copy / paste).
UPDATE mysql.user SET Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', Index_priv='Y', Alter_priv='Y', Show_db_priv='Y', Super_priv='Y', Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y', Create_tablespace_priv='Y' WHERE User='root';
FLUSH PRIVILEGES;
 

Note that the update should report that it has updated more than one row, that because there are actually 3 user accounts with the userid of 'root' each with a different domain i.e. 127.0.0.1, localhost and ::1

7. Now enter 'quit' at the mysql command promt to exist mysql.

8. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

9. Edit the my.ini file
wampmanager -> MySQL -> my.ini

10. Find the [wampmysqld] or [wampmysqld64] section in the ini file
Remove the 'skip-grant-tables' and 'shared-memory=on' parameters we added earlier.
DO NOT Leave this parameter in the ini file its a HUGH security hole.

11. Restart the mysql service.
wampmanager -> MySQL -> Service -> Start/Resume Service

You shoud now be able to login with phpmyadmin using the userid 'root' and the new password you have just set for that user.

------------------ MYSQL 8.0.0 --------------------
This procedure above may not work with MySQL before 8.0.15:
See: BUG 90554
See: MySQL 8.0.x : How ro reset root password

- 1 - Create a text file containing the password-assignment statement on a single line.
Replace the password with the password that you want to use.
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'MyNewPass' PASSWORD EXPIRE NEVER;
Save the file. This example assumes that you name the file C:\mysql-init.txt.

- 2 - Launch Wampserver
- 3 - Stop MySQL service
Left-Click -> MySQL -> Service administration -> Stop service

- 4 - Open a command window on the bin MySQL folder
Right-Click -> Tools -> Command Windows -> Command window MySQL/bin

- 5 - In this command window type:
mysqld --init-file=C:\\mysql-init.txt
Beware of the two \\
Close the command window.

- 6 - Start MySQL service
Left-Click -> MySQL -> Service administration -> Start/Resume service

The new password is taken into account.



Edited 3 time(s). Last edit at 08/16/2024 01:36PM by Otomatic.

Options: ReplyQuote


Sorry, you can't reply to this topic. It has been closed.