database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 1826 게시물 읽기
No. 1826
Re: shell script로 DB connect 하려는데 안돼네여..
작성자
김순석
작성일
2000-05-26 02:29
조회수
4,734

안녕하세요.

 

[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;';

>

> 근데..접근이 안되니까...

>

> 아시는 분 계시면...답변좀...

[Top]
No.
제목
작성자
작성일
조회
1818[질문]입니다.. C++Builder와 mySQL을 바로 연결하는 방법..
임승택
2000-05-25
4585
1815윈도우에서 작업한 DB를 리눅스로...
허상철
2000-05-25
4294
1817┕>Re: 윈도우에서 작업한 DB를 리눅스로...
정재익
2000-05-25 15:06:46
5168
1812초보입니다. 갈쳐 주세요
갈매기
2000-05-25
4426
1813┕>Re: 초보입니다. 갈쳐 주세요
정재익
2000-05-25 14:22:05
4364
1810shell script로 DB connect 하려는데 안돼네여..
서현수
2000-05-25
4584
1811┕>Re: shell script로 DB connect 하려는데 안돼네여..
정재익
2000-05-25 13:54:24
4276
1816 ┕>Re: Re: shell script로 DB connect 하려는데 안돼네여..
서현수
2000-05-25 15:05:42
4467
1821  ┕>Re: Re: Re: shell script로 DB connect 하려는데 안돼네여..
정재익
2000-05-25 16:53:40
4541
1826┕>Re: shell script로 DB connect 하려는데 안돼네여..
김순석
2000-05-26 02:29:03
4734
1807# 왜 이런 에러가?(ERROR 1045: Access denied for user...)
오원근
2000-05-25
4686
1809┕>Re: # 왜 이런 에러가?(ERROR 1045: Access denied for user...)
정재익
2000-05-25 10:59:46
5021
1803# 체크박스의 DB구성
김현석
2000-05-25
3963
1804┕>Re: # 체크박스의 DB구성
정재익
2000-05-25 03:56:32
4601
1802# [급질문]ASP 연결 할때?
송현정
2000-05-24
4265
1814┕>Re: # [급질문]ASP 연결 할때?
정재익
2000-05-25 14:35:53
4794
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다