안녕하세요.
[root@stockchat bin]# ./mysql -u root -ppassword db
위에서 처럼 패스워드는 붙여서 사용하셔야 합니다. p뒤에 공백없이 붙여씁니다.
아니면 재익님이 말씀하신대로 아래와 같이 사용하시구요.
[root@stockchat bin]# ./mysql -u root --password=패스워드 db
그리고 위와 같이 해서 연결이 안되고 쉘계정 root 상태에서 접근이 된다면
mysql 설치후에 root 의 패스워드를 혹 셋팅하셨는지요?
다시 확인해 보시기 바랍니다.
그리고 아래와 같이 명령하면 화일이 생성될 겁니다.
생성된 화일의 위치는 어디신지 아시겠죠...?
shell>/usr/local/mysql/bin/mysql -u root -ppassword db -e 'select count(*) into outfile "asdf.txt" from member'
성공하시길...
> [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" fr
> om member;';
>
> 근데..접근이 안되니까...
>
> 아시는 분 계시면...답변좀...
|