Access Phpmyadmin remotly

Go to the file C:\xampp\apache\conf\extra\httpd-xampp.conf

It you have this bit of v=code in that file then edit it or if not then add it to that file


# New XAMPP security concept
#
<LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
Require local
Require ip 192.168
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var

 

XAMPP/WAMP Reset ROOT Password

If the problem is just a forgotten password this will allow you to reset it. However if you have mixed incompatible databases with MySQL Server versions there will be other problems later once you have reset the password.

 

Stop the mysql service

wampmanager -> MySQL -> Service -> Stop Service

Edit the my.ini file

wampmanager -> MySQL -> my.ini

Find the [wampmysqld] section in the ini file. Add this line directly after the section [wampmysqld]

skip-grant-tables

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

Open the MySQL console wampmanager -> MySQL -> MySQL Console

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

UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass'), 
                      password_expired = 'N' 
WHERE User = 'root';
FLUSH PRIVILEGES;

Note that the update should report that it has updated more than one row, that is 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*

Now enter ‘quit’ at the mysql command promt to exist mysql.

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

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

Find the [wampmysqld] section in the ini file Remove the skip-grant-tables parameter we added earlier.

DO NOT Leave this parameter in the ini file its a HUGH security hole.

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

Automatically Backup MySQL Databases on Windows

The best way to create and automate backups of MySQL databases is to:

1. Use the Windows Task Scheduler to automatically run a backup task every day or week.

2. Have the task run a BATCH file containing the “mysqldump” and “makecab” commands to export and compress the databases.

3. For additional recovery, use MySQL’s Binary Log files to record transactions between backup jobs (to rebuild the database to the last transaction recorded).

This solution will work for everything from Windows 10, down to XP, and Server 2003. No external tools are required.

 

Backup MySQL Databases with Batch File

Create a mysql-backup.bat file to export all the databases (or only select databases), using a DATE-TIME file-name stamp, and compress the SQL file…

@ECHO OFF

set TIMESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%

REM Export all databases into file C:\path\backup\databases.[year][month][day].sql
"C:\path-to\mysql\bin\mysqldump.exe" --all-databases --result-file="C:\path-to\backup\databases.%TIMESTAMP%.sql" --user=username --password=password

REM Change working directory to the location of the DB dump file.
C:
CD \path-to\backup\

REM Compress DB dump file into CAB file (use "EXPAND file.cab" to decompress).
MAKECAB "databases.%TIMESTAMP%.sql" "databases.%TIMESTAMP%.sql.cab"

REM Delete uncompressed DB dump file.
DEL /q /f "databases.%TIMESTAMP%.sql"

Make sure to update all the paths used, and the MySQL’s username (root) and password (if no password is used, leave the “--password” switch out).

Why use CAB instead of ZIP?…

MS-CAB files have almost 50% better compression ratios over ZIP (especially for single files), and the MAKECAB/EXPAND commands exist on all Windows versions.

Scheduled MySQL Backup Task

Create a Windows Task to run the above BATCH file every day or every week.

Make sure that:

1. The user has rights to Log on as a batch job.

2. If the drive/path you are exporting to is a mapped drive, to use the UNC path.

3. If the drive/path is a shared folder, the user the task is ran on has the correct permissions.

Use MySQL Binary Log

Verify that my.ini has the Binary Log enabled, set to either a MIXED or ROW mode, and does not expire between backup tasks (make it 2x the frequency of the backup task schedule +1 day).

log-bin=mysql-bin
binlog-format=MIXED
expire_logs_days=15

This way you can restore to the last transaction recorded by replaying the log over the last backup job.

Access multiple virtual host from another machine or remote PC

In addition to danp’s answer, you can access the virtual host without having to change the client machine’s etc/hosts file by assigning a port to the virtual host. This is ideal if you want to access the server with a mobile or tablet device:

1) Edit server’s httpd.conf file:

\wamp\bin\apache\apache2.2.x\conf\httpd.conf

Search for “Listen” (around line 61). You should see the following that allows for Apache to listen for port 80:

Listen 0.0.0.0:80
Listen [::0]:80

Add the following lines to add listening for port 81 (or any port):

Listen 0.0.0.0:81
Listen [::0]:81

2) Edit httpd-vhosts.conf: \wamp\bin\apache\apache2.2.x\conf\extra\httpd-vhosts.conf

Change your virtual host tag to port 81:

<VirtualHost *:81>
    DocumentRoot "D:/websites/project1/"
    ServerName www.project1.com
</VirtualHost>

3) Restart Apache server.

4) On the client machine/tablet/mobile, on the web browser enter the server’s ip address (192.168.0.10, or whatever IP) and port as the URL in the following format:

http://192.168.0.10:81

 

Thats all you need


					

Ubuntu 14.04 LTS: Codecs and Multimedia Updates

A Quick Installation
The first thing you will want to pull down for your desktop environment is a common package for the more prevalent codecs. This is now more of a one liner whereas in the past it meant including this package along with a large number of others. In the case of Ubuntu 14.04 LTS, we can get most of what we want by doing a:
sudo apt-get install ubuntu-restricted-extras

The items that you will see installed include the following:

  • Flashplugin-installer
  • gstreamer-ffmpeg
  • gstreamer-pitfdll (helps with Windows binary codec play)
  • gstreamer-plugins-bad
  • gstreamer-plugins-bad-multiverse
  • gstreamer-plugins-ugly
  • gstreamer-plugins-ugly-multivers
  • icedtea6-plugin (java browser plugin for java applets)
  • libavcodec-extra-52 (linux ffmpeg codec – used in majority of files)
  • libmp4v2-0
  • ttf-mscorefonts-installer (Microsoft fonts for better display)

At this point, for most desktop users, you can call it a day. This will allow you to play a large array of videos using mplayer or your browser. However, we can add a bit more flexibility with just a few more items.

The “All In One” Solution for Desktop Media Playback
Of course I would be remiss if I didn’t briefly go over the easiest way to play any video that you may want to play on your desktop including DVDs, BluRays, HD Videos, MP4, etc. etc. etc. Thanks to the efforts of the kind developers at VideoLan, we all can download and install a native Linux media player that is completely self contained (in terms of codec support – no external library, links, versions or otherwise needed), and its in the repositories:
sudo apt-get install vlc

That will quickly give you a full media player for playing any content your heart desires that looks like this:

VLC Media Player in Ubuntu 14.04 LTS

Final Thoughts
In the not too distant past, you were left with needing to install and configure a number of codecs, libraries and their dependencies. Most sites and browsers now are perfectly happy using the comprehensive set of codecs included in the restricted package. Finally, for your desktop needs, the all in one media player that VLC has become (for the price of… free!) cannot be beat with a wooden stick. Although Ubuntu continues to distance itself from the generic “Linux” association, it continues to make strides in usability in an arena (desktop) that has been hard for anyone but Microsoft and Apple to become a player in.

If you use Ubuntu or Linux in general for specific multimedia tasks, hit us up in the comments below and share your experiences.