mardi 5 mai 2015

Some mySQL statements only work after appending \g, other statements don't mind?

I'm trying to embrace mySQL commands in the raw form without using phpMyAdmin and I ran into this little issue so far...

I'm just wondering, I can connect to my db using wamp server and some commands won't work without typing \g after. For instance, I can connect, type my password and then immediately if I just try to create a database via:

CREATE DATABASE testing

It pushes me into a newline that looks like so:

mysql> CREATE DATABASE testing
    ->

1. How do I get back to a regular line to type after this happens? I keep having to close the command prompt and re initiate which is a hassle. 2. Why does it do this? Then when I type the following the command works just fine.

CREATE DATABASE testing \g

OK, now if that were the case I'd just understand and always type \g after everything because I know some things just "ARE" in programming. But then, I can type this line without the \g and it changes databases just fine.

USE firstdb

I haven't tested further on which commands do and don't work with/without the GO command but I thought I'd ask before I confuse myself a million times.

Much appreciated SO community! Thx in advance.

(Also, since I'm new to SO can someone please leave a comment on how to create those code snippets, but in the inline-block format so I don't have to always have to break my code references out onto new lines? Thanks!)

Aucun commentaire:

Enregistrer un commentaire