Monday, August 5, 2013

MySQL installation errors and solutions.

 libstdc++.so.5: cannot open shared object file


Some times while executing the "mysql_install_db" script we get this error.

While loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

You can check whether this library file is there using this command.

>ls -l /usr/lib | grep -i libstdc++

In my case it returns
lrwxrwxrwx.  1 root root       19 Jul 26 17:34   libstdc++.so.6 -> libstdc++.so.6.0.17
-rwxr-xr-x.  1 root root   926280 Sep 21  2012 libstdc++.so.6.0.17

so I download libstdc++.so.5 rpm from here and install the rpm. After that i got the result like this.

lrwxrwxrwx.  1 root root       18 Aug  5 19:00 libstdc++.so.5 -> libstdc++.so.5.0.7
-rwxr-xr-x.  1 root root   763204 May  5 05:14 libstdc++.so.5.0.7
lrwxrwxrwx.  1 root root       19 Jul 26 17:34 libstdc++.so.6 -> libstdc++.so.6.0.17
-rwxr-xr-x.  1 root root   926280 Sep 21  2012 libstdc++.so.6.0.17

Then i try the "mysql_install_db" script and it works.

Getting (errno: 13) in mysqld.log file.

Ex:
/usr/local/mysql/bin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

Then check the "/var/lib/mysql" ownership.
> ll /var/lib/mysql
The "mysql" folder and its child's should have the mysql user ownership.

Getting (errno: 2) in mysqld.log file.

Ex:
130805 20:08:55 [ERROR] /usr/local/mysql/bin/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 2)
130805 20:08:55 [ERROR] Can't start server: can't create PID file: No such file or directory

Check whether there exist a folder called "mysqld" in /var/run and has correct permission. That folder ownership should be given to mysql user.


Before try a new installation you need to delete these 5 things.
1) /var/lib/mysql
2) /usr/bin/mysql3) /var/run/mysqld
4) /usr/local/mysql    - Symbolic link
5) /usr/local/mysql-x.x.x-m2-linux-x86_64-icc-glibc23   - The extracted folder.


Log path : /var/log/mysqld.log

Thursday, June 6, 2013

Simple tool to get diff and merge text files.

I found a simple GUI tool to diff and merge text files called Meld. It provides two- and three-way comparison of both files and directories, and has support for many popular version control systems.

http://meldmerge.org/


Tuesday, February 19, 2013

How to get history of mysql commands

Actually i know how to get the shell command history on linux. We just need to type "history" and press enter. Like wise if we need to get the mysql command history, this is the way.

Go to shell.
> cat ~/.mysql_history

Monday, February 18, 2013

Alias on Linux profile

I had a problem on ubuntu (& debian)shells. That is i can't use "ll" command as i used in Fedora. Most of the time I use "ll" command just after go into a folder. Always i retyped "ls -l" to get the same out put which gives from "ll" command on fedora. So I found a simple solution for it. That is use alias on profile.

Open the profile
&gt vi ~/.profile

Add this at the bottom.
#Alias 
alias ll="ls -l"

Save and quit.
:wq

Source the profile
>source ~/.profile

Now check the result.
>ll

   You feel like fedora...

Tuesday, January 1, 2013

Chrome browser + Selenium issue.

I tried to automate the chrome browser with selenium. I just need to open the chrome browser, go to google.com, enter "land" on search box, press search and check the browser title.

Here is my code:
System.setProperty("webdriver.chrome.driver", 
           "/media/partition1/QA/selenium_automation/chromedriver");
WebDriver driver1 = new ChromeDriver();

driver1.get("http://www.google.com");
WebElement element1 = driver1.findElement(By.name("q"));
element1.sendKeys("land");
element1.submit();
System.out.println("Page title is: " + driver1.getTitle());
(new WebDriverWait(driver1, 10)).until(new ExpectedCondition() {
    public Boolean apply(WebDriver input) {
         return input.getTitle().toLowerCase().startsWith("land");
    }
});
System.out.println("Page title is: " + driver1.getTitle());
driver1.quit();

How ever when im running this i got an exception. This is the important part of it.

/opt/google/chrome/google-chrome: /lib/libz.so.1: no version information available (required by /opt/google/chrome/google-chrome)
/opt/google/chrome/google-chrome: /lib/libz.so.1: no version information available (required by /opt/google/chrome/google-chrome)
/opt/google/chrome/chrome: /lib/libz.so.1: no version information available (required by /opt/google/chrome/chrome)
/opt/google/chrome/chrome: /lib/libz.so.1: no version information available (required by /opt/google/chrome/chrome)
/opt/google/chrome/nacl_helper: /lib/libz.so.1: no version information available (required by /opt/google/chrome/nacl_helper)

I just see the browser opens and suddenly disappears. I checked my chrome version. It was 17. But the current stable version is 23. So I installed the new version. It resolved my issue.

RPM

How to install a "rpm" file on linux (Fedora)

> rpm -ivh <package>.rpm


How to uninstall an installed rpm.

First you need to find out the package name.

> rpm -qa | grep <part_of_the_package_name>

It will give you the full package name. So you can uninstall it.

> rpm -e <package_name>