Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 17/06/2006, à 19:22

eurika

[mysql] [Resolu] erreur SQL syntax ???

Bonjour,

Je viens d'installer un serveur lamp sur mon portable afin de tester les différents CMS qui existent.

J'ai suivis ce tutorial  doc.ubuntu-fr.org/serveur/lamp_bis mais j'ai du loupé un truc car il m'est impossible de lancer une commande sur mon serveur mysql... hmm
Et donc je ne peux pas installer mes CMS hmm

slash@xxxxx:/var/www/jaws-project-0.5.5/html$ mysql -u slash -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 21 to server version: 5.0.22-Debian_0ubuntu6.06-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE' at line 1

et

slash@xxxxx:/var/www/jaws-project-0.5.5/html$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 23 to server version: 5.0.22-Debian_0ubuntu6.06-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DATABASE' at line 1
mysql>

Merci d'avance

eurika

Ps: la commande est SHOW DATABASES;
le fin de samedi ....:rolleyes:

Dernière modification par eurika (Le 17/06/2006, à 20:32)

Hors ligne

#2 Le 17/06/2006, à 20:41

gene69

Re : [mysql] [Resolu] erreur SQL syntax ???

man mysql

MYSQL COMMANDS
       mysql sends each SQL statement that you issue to the server to be
       executed. There is also a set of commands that mysql itself interprets.
       For a list of these commands, type help or \h at the mysql> prompt:

       mysql> help
       List of all MySQL commands:
       Note that all text commands must be first on line and end with ’;’
       ?         (\?) Synonym for ‘help’.
       clear     (\c) Clear command.
       connect   (\r) Reconnect to the server. Optional arguments are db and host.
       delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line
as
                      new delimiter.
       edit      (\e) Edit command with $EDITOR.
       ego       (\G) Send command to mysql server, display result vertically.
       exit      (\q) Exit mysql. Same as quit.
       go        (\g) Send command to mysql server.
  notee     (\t) Don’t write into outfile.
       pager     (\P) Set PAGER [to_pager]. Print the query results via PAGER.
       print     (\p) Print current command.
       prompt    (\R) Change your mysql prompt.
       quit      (\q) Quit mysql.
       rehash    (\#) Rebuild completion hash.
       source    (\.) Execute an SQL script file. Takes a file name as an argument.
       status    (\s) Get status information from the server.
       system    (\!) Execute a system shell command.
       tee       (\T) Set outfile [to_outfile]. Append everything into given
                      outfile.
       use       (\u) Use another database. Takes database name as argument.
       charset   (\C) Switch to another charset. Might be needed for processing
binlog with multi-byte charsets.
       warnings  (\W) Show warnings after every statement.
       nowarning (\w) Don’t show warnings after every statement.

       Each command has both a long and short form. The long form is not case
       sensitive; the short form is. The long form can be followed by an
       optional semicolon terminator, but the short form should not.

       In the delimiter command, you should avoid the use of the backslash
  (‘\’) character because that is the escape character for MySQL.

       The edit, nopager, pager, and system commands work only in Unix.

       The status command provides some information about the connection and
       the server you are using. If you are running in --safe-updates mode,
       status also prints the values for the mysql variables that affect your
       queries.

       To log queries and their output, use the tee command. All the data
       displayed on the screen is appended into a given file. This can be very
       useful for debugging purposes also. You can enable this feature on the
       command line with the --tee option, or interactively with the tee
       command. The tee file can be disabled interactively with the notee
       command. Executing tee again re-enables logging. Without a parameter,
       the previous file is used. Note that tee flushes query results to the
       file after each statement, just before mysql prints its next prompt.

       By using the --pager option, it is possible to browse or search query
       results in interactive mode with Unix programs such as less, more, or
       any other similar program. If you specify no value for the option,
       mysql checks the value of the PAGER environment variable and sets the
       pager to that. Output paging can be enabled interactively with the
pager command and disabled with nopager. The command takes an optional
       argument; if given, the paging program is set to that. With no
       argument, the pager is set to the pager that was set on the command
       line, or stdout if no pager was specified.

       Output paging works only in Unix because it uses the popen() function,
       which does not exist on Windows. For Windows, the tee option can be
       used instead to save query output, although this is not as convenient
       as pager for browsing output in some situations.

       Here are a few tips about the pager command:

       ·  You can use it to write to a file and the results go only to the
          file:

          mysql> pager cat > /tmp/log.txt
          You can also pass any options for the program that you want to use
          as your pager:

          mysql> pager less -n -i -S

       ·  In the preceding example, note the -S option. You may find it very
          useful for browsing wide query results. Sometimes a very wide result

       help      (\h) Display this help.
       nopager   (\n) Disable pager, print to stdout.
....

je vois nulle par la trace d'une commande SHOW

tu as appris sous oracle?


Quand le berger est lâche, le loup chie de la laine.
A (draft) guide to UFO Alien-Invasion

Hors ligne

#3 Le 18/06/2006, à 00:50

eurika

Re : [mysql] [Resolu] erreur SQL syntax ???

Hors ligne