LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-20-2016, 06:21 AM   #1
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Rep: Reputation: Disabled
mysql "->" problem


Hi there

when in mysql if you type a wrong character, it seems to get stuck in the "->" cursor, how do you cancel it, because currently, I am having to quit mysql delete the database and start again from scratch. Is there a way to undo typo errors, or is this the ultimate in unforgiving software?
 
Old 09-20-2016, 06:28 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hello

It just means it is waiting for a ; to complete the SQL. So you can either just type ; or press Control+C to abort it.

Edit:

It can also mean you are inside a string. For example you enter

Quote:
select "
Then you'll have to finish it with "; to complete the SQL. But anyway, you can press Control+C.

Last edited by Guttorm; 09-20-2016 at 06:31 AM.
 
Old 09-20-2016, 06:28 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Maybe try: \c to cancel current command
 
Old 09-20-2016, 07:41 AM   #4
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
Unfortunately, ctrl-C just quits mysql, and I have tried the ";" thing, and that does nothing. It's not very user friendly is it?
 
Old 09-20-2016, 07:43 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Code:
mysql > help
...
clear     (\c) Clear the current input statement.
...
 
Old 09-20-2016, 07:54 AM   #6
Axel van Moorsel
Member
 
Registered: Jan 2011
Location: Netherlands (Zuid Holland)
Distribution: Debian 8
Posts: 31

Rep: Reputation: 4
Hello "iFunction"

Maybe it would help if you specify what you want to do. I find it very strange that you have to delete the database and start all over again.

If you are new to MySql, you might consider using phpMyAdmin. It will provide a graphical interface to manage a database, and gives you the sql code for actions you perform. You can download a portable version (xampp) fromhttps://www.apachefriends.org/index.html. This will give you the opportunity to test things first before you apply them in your live database.

Please note that with xampp comes MariaDB. This works (as far as I know) exactly the same as MySql.
 
Old 09-20-2016, 07:56 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Wrong character?
usually an unpaired single or double quotes in the sql command does it for me.
If that seems to be the case, issue a ' or a " on the
subsequent prompt from mysql.
 
Old 09-21-2016, 07:55 AM   #8
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
The problem I have here is that I am learning, and litterally just putting in a mistyped spelling of something suddenly becomes a case of delete whole thing and start again, in writing this post I have made at least 15 typos, but used the delete key to get rid of them, when using emacs, I can edit as I like, even in the terminal or a python shell, I can go back and redo a mistake, but with MySQL, tap a ' and enter by mistake, and that's it, can't get out of the string cursor, without closing down MySQL, is there not just a simple combination that can cancel the last entry made?
 
Old 09-21-2016, 08:24 AM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Yes, see my previous posts
 
1 members found this post helpful.
Old 09-21-2016, 10:32 AM   #10
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
keefaz, perfect, thank you very much, you also showed me how to search for my own help also (which I should have been able to work out, but with an iq similar to my shoe size I wasn't able to), thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't locate object method "connect" via package "mysql" (perhaps you forgot to load xman fiji Linux - Newbie 9 07-11-2012 08:05 PM
mysql "flush logs" or "flush tables with read lock", ... hangs deadeyes Linux - Server 4 01-19-2010 03:24 AM
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 10:32 AM
Huge (Perl) problem: "DBD::mysql" fails on host Apache... sundialsvcs Programming 2 02-28-2009 03:58 PM
Buzilla issue: "Can't connect to local MySQL server through socket '/tmp/mysql.sock'" vitopn Linux - General 3 05-21-2007 10:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration