Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: mysql-client-5.1 readline is not working anymore

  1. #1
    Join Date
    May 2008
    Beans
    21

    Question mysql-client-5.1 readline is not working anymore

    Hi there,

    after installing mysql-5.1 (which removed mysql-5.0) the readline abilities in mysql stopped working.
    eg Ctrl-r is not giving me a search.

    Can someone verify this behavior?

    I found the following in the changelog:
    Replaced --without-readline to --with-libedit to configure options, as
    --without-readline doesn't seem to do the right thing anymore.

    I suppose this is related to readline or a replacement to readline. Still ldd does not report libreadline oder libedit or something... just ncurses...

    Greets acron

    OS: ubuntu jaunty

  2. #2
    Join Date
    May 2009
    Beans
    1

    Re: mysql-client-5.1 readline is not working anymore

    It looks like libreadline was replaced with libedit. I'm not sure if Ctrl+R is supported in libedit.

    I found this thread via google because upgrading to mysql-client-5.1 caused my ( libreadline .inputrc configured ) vi bindings to stop working.

    I got my vi bindings back in mysql by doing the following:

    Code:
    echo "bind -v" > ~/.editrc
    Thanks for the libedit tip!
    Last edited by fansipans; May 15th, 2009 at 07:11 PM.

  3. #3
    Join Date
    Mar 2009
    Beans
    40

    Re: mysql-client-5.1 readline is not working anymore

    For whatever reason, the version of mysql in the repo is now the non-gpl'ed version which uses editline instead of readline. I had to add create an .editrc file with the following lines to get ctrl-R and DELETE to work.

    bind "\e[3~" ed-delete-next-char
    bind "^R" em-inc-search-prev

    Alternately you could build the CLI from source or do what I'm gonna try next which is install rlwrap and alias the mysql command like this...

    alias mysql='rlwrap -a mysql'
    Last edited by chuckh1958; July 21st, 2009 at 05:21 PM.

  4. #4
    Join Date
    Dec 2007
    Beans
    6

    Re: mysql-client-5.1 readline is not working anymore

    thanks for the rlwrap tip!
    This piece of software is gold

  5. #5
    Join Date
    Sep 2009
    Beans
    1

    Question Re: mysql-client-5.1 readline is not working anymore

    Thanks, it works. But inconvenient create this file in your home directory for each user. I created these lines in the file /etc/editrc and /etc/inputrc, but MySQL does not read them
    What can I do?

  6. #6
    Join Date
    Oct 2009
    Beans
    3

    Re: mysql-client-5.1 readline is not working anymore

    This did not work for me. I created a .editrc file, filled it with the commands suggested above, and got no luck in getting vi-style command-line editing to work in mysql client, nor in getting any style history searching working. emacs style history browsing works ^p and ^n and the arrow keys work, but nothing I put in any file seems to alter that behavior or add searching (I'd be happy with either ^R or ESC/, though I'd prefer the latter of course. Has anyone had any further experience/solutions for this problem?

  7. #7
    Join Date
    Jan 2005
    Location
    Washington DC
    Beans
    329

    Re: mysql-client-5.1 readline is not working anymore

    I also tried the .editrc and its no longer working for me after I upgraded to karmic... really loved ctrl-r history searching and would like to get it back. having the delete key work again would be great as well.

  8. #8
    Join Date
    Jan 2005
    Location
    Washington DC
    Beans
    329

    Re: mysql-client-5.1 readline is not working anymore

    Quote Originally Posted by s_p_a_r_k_y View Post
    I also tried the .editrc and its no longer working for me after I upgraded to karmic... really loved ctrl-r history searching and would like to get it back. having the delete key work again would be great as well.
    I downgraded to 5.0 steps before downgrading

    backup database either by cp /var/lib/mysql /var/lib/mysql.5.1 -R or by running mysqldump --all-databases -r /root/all.sql

    Then remove these files from /var/lib/mysql mysql_upgrade_info and debian-5.1.flag

    Then remove mysql with apt-get remove mysql-server-5.1 mysql-client-5.1

    and add in the new (old) version of mysql with

    apt-get install mysql-server-5.0 mysql-client-5.0

    it will run over the db install again but should have all the DBs from before. Not recommended on production environment, I just did it on my laptop where I test my code so for me having ctrl-r was very important.

  9. #9
    Join Date
    Nov 2009
    Beans
    1

    Re: mysql-client-5.1 readline is not working anymore

    Has anyone fixed this at 5.1?

    .editrc and rlwrap both do not work. Kind of makes me mad having have to keep retyping same queries...

    Also, is 5.0 better for production server? I heard 5.1 is quite different.
    Though it sounds like Ubuntu's decision is a bad one if it is, otherwise I'd like to stick with 5.1 and fix this issue...

  10. #10
    Join Date
    Oct 2009
    Beans
    13

    Re: mysql-client-5.1 readline is not working anymore

    Hello! I just want to add my voice to the choir of those who are in pain because of Ctr-R and the other nice readline features no longer working in the mysql client since I upgraded to Karmic. : (

    Any indication on how to fix this is most appreciated. Besides the approaches suggested above, I also tried recompiling the client from the source I got from mysql.com (5.1.40), but that didn't fix things, either.

    Any advice would be terrific. : )

    /lara

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •