Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am installing MySQL Server from the source distribution which I downloaded from:

http://dev.mysql.com/downloads/mysql/#downloads.

I have downloaded the file (mysql-5.5.19.tar.gz).

I am using Debian/Ubuntu Machine. I am following the instructions as given in MySQL Documentation.

After issuing cmake . at the shell I am getting the following error:

-- MySQL 5.5.19
-- Could NOT find Curses  (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:127 (FIND_CURSES)
  cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
  CMakeLists.txt:257 (MYSQL_CHECK_READLINE)


-- Configuring incomplete, errors occurred!

Why am I getting this error?

share|improve this question
    
Just a recommendation : You should not use source-compiled versions of MySQL because certain compiler optimizations that RPM installations provide would be your responsibility to set before compiling. In most cases, you get slower and/or more bloated mysql binaries. You should install RPM or tar versions instead. – RolandoMySQLDBA Jan 6 '12 at 17:13
    
You should probably ask yourself why you are building from source at all given the proliferation of packages available. I can't think of any reason why it would make sense to build from source unless you are actually developing MySQL. – Aaron Brown Jan 23 '12 at 21:33

This may happen due to two reasons.
1. you don't have the curses library installed. This can solved with using below command.

sudo apt-get install libncurses5-dev


2. You haven't configure cmake correctly to find the curses library.

if you have installed the library correctly using above command, use below to locate it.

locate libncurses.so

mine is /usr/lib/x86_64-linux-gnu/libncurses.so (Normally the last path.)
Now you have to locate curses.h. Use below command.

locate curses.h

This will give you several path but the all in the /usr/include So that is what we need. Now we have to configure the curses location. Find your cmake folder in there is /Modules/FindCurses.cmake open it. (Full path for cmake in mine is /usr/share/cmake-3.2/Modules/FindCurses.cmake If you can't find manually where cmake installed search for cmake on your Ubuntu partition.)

Add these top of file after comments. (with your respective locations.)

set( CMAKE_INCLUDE_PATH "/usr/include")
set( CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu/libncurses.so")

This would do your job.

share|improve this answer
1  
locate won't find a thing if you haven't run updatedb recently – Phil Feb 26 at 11:46
    
Mine work fine. I frequently updates it. BTW Thanks Phil :) – Menuka Ishan Feb 26 at 11:48

The clue is in the error message (which I also encountered today):

  1. install the correct Curses library. If you're on Debian/Ubuntu then install libncurses5-dev ( use sudo apt-get install libncurses5-dev )
  2. then remove CMakeCache.txt and rerun cmake. i.e. just do rm -f CMakeCache.txt.
  3. Re-run cmake .
share|improve this answer
    
Important point for me rm -f CMakeCache.txt :) thanks – Mostafa Shahverdy May 30 '14 at 13:50

Your build can't find ncurses. Either you don't have it installed or it cant be found where it is installed.

If you don't have it, simply download it, build it, install it, and make sure LD_LIBRARY_PATH can find it.

If for any reason cmake still cant see it, you can pass the lib and include directories to cmake at runtime, such as:

shell> cmake -DCURSES_LIBRARY=/path/to/lib/libncurses.a -DCURSES_INCLUDE_PATH=/path/to/include/ .

Note, unlike any sane tool, you actually have to pass it the full path to the specific lib, right up to and including the library name itself.

Ignore the comments above regarding building from RPM; package managers are for hobbyists and power users, not professionals; you're doing it right.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.