Wednesday, 14 October 2015

MySQL - Resetting a lost MySQL root password


MySQL - Resetting a lost MySQL root password
The MySQL root password allows full access to the MySQL database and allows for all actions to be undertaken including creating new users, new databases, setting access rules and so on.
Losing one can be a difficult issue to encounter. Luckily, resetting the root password is easy as long as you have sudo access to the Server.
Not the Server root user
A common issue is confusing the Server root user with the MySQL root user.
The Server root user is the server's main user. The MySQL root user has complete control over MySQL only. The two 'root' users are not connected in any way.
Stop MySQL
The first thing to do is stop MySQL. If you are using Ubuntu or Debian the command is as follows:
sudo /etc/init.d/mysql stop
For CentOS, Fedora, and RHEL the command is:
sudo /etc/init.d/mysqld stop
Safe mode
Next we need to start MySQL in safe mode - that is to say, we will start MySQL but skip the user privileges table. Again, note that you will need to have sudo access for these commands so you don't need to worry about any user being able to reset the MySQL root password:
sudo mysqld_safe --skip-grant-tables &
Note: The ampersand (&) at the end of the command is required.
Login
All we need to do now is to log into MySQL and set the password.
mysql -uroot
Note: No password is required at this stage as when we started MySQL we skipped the user privileges table.
Next, instruct MySQL which database to use:
use mysql;
Reset Password
Enter the new password for the root user as follows:
update user set password=PASSWORD("mynewpassword") where User='root';
and finally, flush the privileges:
flush privileges;
Restart
Now the password has been reset, we need to restart MySQL by logging out:
quit
and simply stopping and starting MySQL.
On Ubuntu and Debian:
sudo /etc/init.d/mysql stop
...
sudo /etc/init.d/mysql start
On CentOS and Fedora and RHEL:
sudo /etc/init.d/mysqld stop
...
sudo /etc/init.d/mysqld start
Login
Test the new password by logging in:
mysql -u root -p
You will be prompted for your new password.         


Monday, 21 September 2015

Exchange 2013 step by step installation in Server 2012 R2

Please follow the below mentioned step by step guide lines in order to install exchange 2013 sp1 in server 2012 R2:

BY USING POWERSHELL:

Install-WindowsFeature RSAT-ADDS
-----------------------

FOR MBX AND CAS SERVER:

Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation, Telnet-Client, RSAT-ADDS
-----------------------

FOR MBX SERVER ONLY:

Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation
-----------------------

FOR CAS SERVER ONLY:

Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation

-----------------------
Install the Microsoft Unified Communications Managed API 4.0 Runtime 64-bit software.
-----------------------
Install Microsoft Office 2010 Filter Packs (FilterPack64bit.exe - 3.9 MB)
-----------------------
SP 1 for Microsoft Office Filter Pack 2010 (KB2460041) (filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe - 3.5 MB)
-----------------------
setup /PrepareSchema /IAcceptExchangeServerLicenseTerms
-----------------------
setup /PrepareAD /OrganizationName:EXCH2013 /IAcceptExchangeServerLicenseTerms
-----------------------
Setup Exchange 2013

-----------------------

Uninstall Microsoft Visual C++ 11 beta redistributable (x64) – 11.0.50531 component

Microsoft Exchange 2013 Step By Step Installation guide on Windows Server 2012 R2



Microsoft released Exchange Server 2013 SP1 on Feb 25, 2014. With the release of Edge Transport server role, Exchange 2013 is finally a complete product. Exchange 2013 now has total of three roles, Mailbox server role, Client Access server role and Edge Transport server role. Exchange 2013 SP 1 also introduced many new features. In this post, I will show steps to install Exchange Server 2013 SP1 in Windows Server 2012 R2.

Install Exchange Server 2013 SP1 in Windows Server 2012 R2

First of all you need to decide whether you want to install Exchange Mailbox server role and Client Access server role on same server. There are different set of prerequisites you must follow depending upon your scenario before you can install Exchange 2013 SP1, so make sure you follow them. This scenario is pretty straight forward with single Domain Controller (i.e; Ex2k13-Dc) and single Exchange Server (i.e; Ex2k13-Exc).
Prerequisites of this type of installation are: –
  1. The Active Directory forest functional level must be at least Server 2003.
  2. The Active Directory site must contain at least one Global Catalog server and a writable domain controller.
  3. Exchange Server must be member of Domain Controller.
  4. Perform Windows Update and reboot the Mail Server.
  5. Install .NET Framework 4.5 and Windows Management Framework 4.0 in Mail Server. In most cases, this feature is installed by default.
  6. Install Remote Server Administration ToolKit in Mail Server. Use PowerShell cmdlet, Install-WindowsFeature RSAT-ADDS.
  7. Run the following command in Windows PowerShell to install other required components.
    Install-WindowsFeature AS-HTTP-Activation, Desktop-Experience, NET-Framework-45-Features, RPC-over-HTTP-proxy, RSAT-Clustering, RSAT-Clustering-CmdInterface, RSAT-Clustering-Mgmt, RSAT-Clustering-PowerShell, Web-Mgmt-Console, WAS-Process-Model, Web-Asp-Net45, Web-Basic-Auth, Web-Client-Auth, Web-Digest-Auth, Web-Dir-Browsing, Web-Dyn-Compression, Web-Http-Errors, Web-Http-Logging, Web-Http-Redirect, Web-Http-Tracing, Web-ISAPI-Ext, Web-ISAPI-Filter, Web-Lgcy-Mgmt-Console, Web-Metabase, Web-Mgmt-Console, Web-Mgmt-Service, Web-Net-Ext45, Web-Request-Monitor, Web-Server, Web-Stat-Compression, Web-Static-Content, Web-Windows-Auth, Web-WMI, Windows-Identity-Foundation
  8. Download and install Microsoft Unified Communications Managed API 4.0, Core Runtime 64-bit in Mail Server.
Before beginning the installation of Exchange 2013 SP1, let’s install some pre-requisites. At first, install the remote server administration toolkit and other required components in mail server.
1. Installing Prerequisites
Then install Microsoft Unified Communications Managed API 4.0. I got an error when I tried to install this application.
Media Foundation
To fix this error, install media foundation feature from Server Manager.
media foundation solution
Now try installing Microsoft Unified Communications Managed API 4.0 again. After installing all the prequisites, let’s begin the installation of Exchange 2013 SP1.

Exchange 2013 SP1 Installation Steps

Now run the Exchange 2013 SP1 installer. The setup will try to get Exchange updates, you can check and download the updates. But here, I will ignore and click Next.
1. Exchange Update
The setup will now take some time to copy the installation files and following Introduction page will appear. Read the page and click Next.
Install Exchange Server 2013 SP1 in Windows Server 2012 R2
Now you are asked to accept license agreement. Choose I accept and click Next.
Accept License Agreement
Here, do not choose the recommended settings and click Next.
Don't Use Recommended Settings
Choose Exchange Server roles and click Next. Here, I will choose Mailbox server role and Client Access server role.
Select Exchange Roles
Point the installation location and click Next. Choose other than C: drive. But here, I will choose the default.
Installation Location
Type the name for this Exchange organization. This could be your organization name. I will type MustBeGeek and click Next. Choose not to disable malware protection and click Next.
Don't disable malware
The server will now perform some prerequisite checks and if all good you can hit the install button. The setup will now start.
Installing Exchange
The setup will take some time to complete the installation.
Setup Completed
Check launch EAC and click Finish. Enter administrator credentials and login. You can also open the Exchange Admin Center by browsing the link, https://localhost/ecp in the browser of the Exchange Server itself.
eac
You have successfully installed Exchange 2013 SP1. Don’t forget to check the latest updates and service packs. You can now create mailboxes. In addition, setup external and internal urls to use mailboxes using different client applications. Also, configure URL redirections. Then configure send connectors to send and receive emails from the Internet.

To check your current build of Exchange 2013 type following cmdlet in Exchange Management Shell.
[PS] C:\Windows\System32>Get-ExchangeServer | fl name,edition,admindisplayversion
Exchange Version
In this way you can install Exchange Server 2013 SP1 in Windows Server 2012 R2.