[root@stockchat bin]# pwd
/usr/local/mysql/bin
[root@stockchat bin]# ./mysql -u root -p password db; <--이렇게 하면
아래와 같이 에러가 떨어지네요.
./mysql Ver 9.36 Distrib 3.22.27, for pc-linux-gnu (i686)
By TCX Datakonsult AB, by Monty
This software comes with ABSOLUTELY NO WARRANTY.
Usage: ./mysql [OPTIONS] [database]
-A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to
get table and field completion. This gives a quicker
start of mysql.
-B, --batch Print results with a tab as separator, each row on
a new line. Doesn't use history file
-C, --compress Use compression in server/client protocol
-T, --debug-info Print some debug info at exit
-e, --execute=... Execute command and quit.(Output like with --batch)
-f, --force Continue even if we get an sql error.
-i, --ignore-space Ignore space after function names
-?, --help Display this help and exit
-h, --host=... Connect to host
-H, --html Produce HTML output
-n, --unbuffered Flush buffer after each query
-O, --set-variable var=option
Give a variable an value. --help lists variables
-o, --one-database Only update the default database. This is useful
for skipping updates to other database in the update
log.
-p[password], --password[=...]
Password to use when connecting to server
If password is not given it's asked from the tty.
-P --port=... Port number to use for connection
-q, --quick Don't cache result, print it row by row. This may
slow down the server if the output is suspended.
Doesn't use history file
-r, --raw Write fields without conversion. Used with --batch
-s, --silent Be more silent.
-L, --skip-line-numbers Don't write line number for errors
-N, --skip-column-names Don't write column names in results
-S --socket=... Socket file to use for connection
-t --table Output in table format
-u, --user=# User for login if not current user
-v, --verbose Write more (-v -v -v gives the table output format)
-V, --version Output version information and exit
-E, --vertical Print the output of a query (rows) vertically
-w, --wait Wait and retry if connection is down
Possible variables for option --set-variable (-O) are:
max_allowed_packet current value: 25165824
net_buffer_length current value: 16384
어떻게 해야 하는 것인지?
shell script로 db접근해서...내용을 파일에다가 쓸려구 하거든요..(주기적으로)
/usr/local/mysql/bin/mysql -u root -p password db -e 'select count(*) into outfile "asdf.txt" from member;';
근데..접근이 안되니까...
아시는 분 계시면...답변좀...
|