1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL command line options.

Discussion in 'MySQL' started by shabbir, Nov 29, 2006.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    MySQL [OPTIONS]

    -?, --help, -I
    Display help.​
    --auto-rehash
    Enable automatic rehashing. Disable with --disable-auto-rehash.​
    -A, --no-auto-rehash
    No automatic rehashing.
    WARNING: options deprecated; use --disable-auto-rehash instead.​
    -B, --batch
    Don't use history file. Disable interactive behavior.​
    --character-sets-dir=name
    Directory where character sets are.​
    --default-character-set=name
    Set the default character set.​
    -C, --compress
    Use compression in server/client protocol.​
    -#, --debug[=#]
    This is a non-debug version. Catch this and exit​
    -D, --database=name
    Database to use.​
    --delimiter=name
    Delimiter to be used.​
    -e, --execute=name
    Execute command and quit.​
    -E, --vertical
    Print the output of a query (rows) vertically.​
    -f, --force
    Continue even if we get an sql error.​
    -g, --no-named-commands
    Named commands are disabled.
    WARNING: option deprecated; use --disable-named-commands instead.​
    -G, --named-commands
    Enable named commands. ​
    -i, --ignore-spaces
    Ignore space after function names.​
    --local-infile
    Enable/disable LOAD DATA LOCAL INFILE.​
    -b, --no-beep
    Turn off beep on error.​
    -h, --host=name
    Connect to host.​
    -H, --html
    Produce HTML output.​
    -X, --xml
    Produce XML output​
    --line-numbers
    Write line numbers for errors.​
    -L, --skip-line-numbers
    Don't write line number for errors.
    WARNING: -L is deprecated, use long version of this option instead.​
    --no-tee
    Disable outfile.
    WARNING: option deprecated; use --disable-tee instead​
    -n, --unbuffered
    Flush buffer after each query.​
    --column-names
    Write column names in results.​
    -N, --skip-column-names
    Don't write column names in results.
    WARNING: -N is deprecated, use long version of this options instead.​
    -O, --set-variable=name
    Change the value of a variable. Please note that this
    WARNING: option is deprecated; ​
    --sigint-ignore
    Ignore SIGINT (CTRL-C)​
    -o, --one-database
    Only update the default database. ​
    -p, --password[=name]
    Password to use when connecting to server. ​
    -W, --pipe
    Use named pipes to connect to server.​
    -P, --port=#
    Port number to use for connection.​
    --prompt=name
    Set the mysql prompt to this value.​
    --protocol=name
    The protocol of connection (tcp,socket,pipe,memory).​
    -q, --quick
    Don't cache result, print it row by row. ​
    -r, --raw
    Write fields without conversion. Used with --batch.​
    --reconnect
    Reconnect if the connection is lost. Disable with --disable-reconnect. ​
    -s, --silent
    Be more silent. Print results with a tab as separator, each row on new line.​
    --shared-memory-base-name=name
    Base name of shared memory.​
    -S, --socket=name
    Socket file to use for connection.​
    -t, --table
    Output in table format.​
    -T, --debug-info
    Print some debug info at exit.​
    --tee=name
    Append everything into outfile. ​
    -u, --user=name
    User for login if not current user.​
    -U, --safe-updates, --i-am-a-dummy
    Only allow UPDATE and DELETE that uses keys.​
    -v, --verbose
    Write more. (-v -v -v gives the table output format).​
    -V, --version
    Output version information and exit.​
    -w, --wait
    Wait and retry if connection is down.​
    --connect_timeout=#
    Number of seconds before connection timeout.​
    --max_allowed_packet=#
    Max packet length to send to, or receive from server​
    --net_buffer_length=#
    Buffer for TCP/IP and socket communication​
    --select_limit=#
    Automatic limit for SELECT when using --safe-updates​
    --max_join_size=#
    Automatic limit for rows in a join when using --safe-updates​
    --secure-auth
    Refuse client connecting to server if it uses old protocol​
    --print-defaults
    Print the program argument list and exit​
    --no-defaults
    Don't read default options from any options file​
    --defaults-file=#
    Only read default options from the given file #​
    --defaults-extra-file=#
    Read this file after the global files are read​
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    What does --disable-auto-rehash do??
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    It disables the hasing of the data when some insert/update occurs on a table.
     
  4. Bhullarz

    Bhullarz New Member

    Joined:
    Nov 15, 2006
    Messages:
    253
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    System Manager
    Home Page:
    I am trying to pass the query using file named "Test.sql" which contains the following commands:
    select now(),version(),user();
    and command I am using in mysql client:
    mysql<c:\test.sql;
    I'm using MYsql Server 5.0.
    Can somebody help me to rectify this error.I tried above mentioned command related to infile and outfile but ech command is giving error.
     
  5. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Try this,
    Code:
    mysql -u Username -pPassword < c:\test.sql
     
  6. Bhullarz

    Bhullarz New Member

    Joined:
    Nov 15, 2006
    Messages:
    253
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    System Manager
    Home Page:
    sir I tried this. But it is not working. Error is as under:

    outfile disabled.
    error 1064 (42000) : You have an errorin your SQL syntax; check the manual that corresponds to your MySQl server version for the right syntax to use near 'mysql<c:est.sql' at line 1

    This is the exact wording.
     
  7. Ajay12

    Ajay12 New Member

    Joined:
    May 7, 2012
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    India, Agartala, Tripura(W)
    Sir can send me the manual for 'mysql 5.5'
     

Share This Page