Reset a forgotten root password for your mysql database

Did you forget the root password for your mysql database?  Don’t fret.  Follow these simple steps to reset it.  You will need to have root access to your server to do this.

(I’m performing this on a debian/ubuntu server.  The redhat/fedora command for stopping/starting the mysql service will be very similar)

(1) Stop your database

$ sudo service mysql stop

(2) Start the database in a full access and full privilege mode

$ sudo mysqld_safe –skip-grant-tables –skip-networking &

(3) Logon without a password

$ mysql -u root mysql

(4) Reset the password

mysql>  update user set Password=PASSWORD(‘my_new_password”) where user=’root’;
mysql>  flush privileges;
mysql>  exit;

(5) Kill the running database and restart it as normal.

$ sudo pkill mysqld
$ sudo service mysql start

You should be able to logon now with  your new password.

Advertisements

Fedora 16 missing H.264 decoder plugin (fixed)

If you installed Fedora 16 and added the RPM fusion repositories and you still can’t watch .mkv videos because of a missing H.264 decoder plugin.

Totem Movie Player gives you this error message

Here is how to fix it.

You are still missing a required package.  Add the following package…and you should be good to go.

sudo yum install gstreamer-ffmpeg

However, If you need full instructions for enabling the RPM fusion repositories here they are also.   The first two lines add the necessary repositories.  The last line installs the necessary plugins for variety of video formats as well as viewing DVDs.

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

sudo yum install gstreamer gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer-ffmpeg libdvdread libdvdnav lsdvd

Enjoy.

Alternatively, you can also install and use vlc or smplayer to view mkv videos–both can decode H.254 .

Ubuntu 11.10: Unity Desktop Poll

Ubuntu 11.10 getting wireless BCM4311 working

I have an HP laptop model nx6325 with a Broadcom BCM4311 wireless card.  After installing Ubuntu 11.10, I find that my wireless doesn’t work.  The reason, Ubuntu detects the wireless but then loads the incorrect driver for this card.

I use the lspci command to display the details about my hardware. It will display all of your PCI connected hardware. I edited the output to show only the relevant information.  The important information here for  matching your hardware with mine is this indentifier [14e4:4312].

$ sudo lspci -v

30:00.0 Network controller: Broadcom Corporation BCM4311 802.11a/b/g (rev 01)
        Subsystem: Hewlett-Packard Company Broadcom 802.11a/b/g WLAN
        Flags: bus master, fast devsel, latency 0, IRQ 18
        Memory at c8000000 (32-bit, non-prefetchable) [size=16K]
        Capabilities: [40] Power Management version 2
        Capabilities: [58] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [d0] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [13c] Virtual Channel
        Kernel driver in use: b43-pci-bridge
        Kernel modules: ssb

$ sudo lspci -nn
30:00.0 Network controller [0280]: Broadcom Corporation BCM4311 802.11a/b/g [14e4:4312] (rev 01)

The Solution

I am  going to install the correct driver for this wireless card. Then I will remove the “incorrect” driver (bcmwl) which Ubuntu installed by default.

$ sudo apt-get update
$ sudo apt-get install firmware-b43-installer
$ sudo apt-get remove bcmwl-kernel-source
$ sudo reboot

Hopefully you found this useful.

If you have this same type of wireless chip in your laptop, these instructions might also work for you.

Fixing Problems with Gnome Indicator Applets

If you are using gnome 2.x and you have problems with your indicator applets not displaying properly after login.   I often do.   I don’t know the reason.  It occurs sporadically and more often than not.

A simple fix is to restart gnome-panel.  You don’t need to use sudo.  Open a terminal and run the following command.


$ pkill gnome-panel

That was easy–and is usually all you need to do.

However, if that didn’t solve your problem.  You can try reseting your panels and get pristine panels again.  WARNING:  If you have customized your panels by adding application launchers and etc, you will lose those setttings and have to customize them again.

Now that you have been warned, here are the steps to reset your panels.


$ gconftool-2 --recursive-unset /apps/panel

$ rm -fr ~/.gconf/apps/panel

$ pkill gnome-panel

I hope you found this post useful.

Configure Ubuntu to start in text mode

In my previous post I showed you how to add the gnome desktop to your Ubuntu server.   Suppose you want to configure Ubuntu to start in text mode rather then automatically starting the gnome desktop.  It is an easy change to make.  Here is how.

1) Edit /etc/default/grub.  Locate and change the following line.

change:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

to:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash text”

Then save your changes.

2) Run

sudo update-grub

The next time you reboot, Ubuntu will boot to text mode and you will see the console login screen (cmdline).  You can start the gnome desktop manually after loggging on by running “startx“.  When you logoff from the gnome desktop, you will be returned to the cmdline again.

Install a graphical desktop on Ubuntu Server 10.04 (without alot of extras)

Sometimes I find the need to install Ubuntu Server with a gnome desktop like the one that you get with Ubuntu Desktop.  You can install Ubuntu Server and then use apt-get to install the package ubuntu-desktop.  However, if you do that you will end up installing almost everything that comes with a Ubuntu Desktop installation.  This is not what I want.

What I really want is a  gnome graphical desktop running on top of Ubuntu Server and very little else.  Here is what I do.

Step 1:

Install Ubuntu Server

Step 2:

Logon and install the following packages.

$ sudo apt-get update

$ sudo apt-get install ubuntu-desktop –no-install-recommends

You will want the indicator applets.

$ sudo apt-get install indicator-applet-complete indicator-applet

If you want a web browser, a good choice is chromium.

$ sudo apt-get install chromium-browser

Step 3:

Reboot and enjoy.

That is all.