mysql - Create databases from SQL file -
i'm working mariadb, have user following :
user : aimad password : test
and want execute command in cmd following :
mysql –u aimad –ptest < create.sql
in create.sql
file have :
create database `db_test_analyse` ; create database `db_backend` ;
but when run command in console , no db created:
d:\bdd>mysql –u aimad –ptest < create.sql mysql ver 15.1 distrib 10.1.16-mariadb, win64 (amd64) copyright (c) 2000, 2016, oracle, mariadb corporation ab , others. usage: mysql [options] [database] default options read following files in given order: c:\windows\my.ini c:\windows\my.cnf c:\my.ini c:\my.cnf c:\program files\mariadb 10.1\my.ini c:\program files\mariadb 10.1\my.cnf c:\program files\mariadb 10.1\ data\my.ini c:\program files\mariadb 10.1\data\my.cnf following groups read: mysql client client-server client-mariadb following options may given first argument: --print-defaults print program argument list , exit. --no-defaults don't read default options option file. --defaults-file=# read default options given file #. --defaults-extra-file=# read file after global files read. -?, --help display , exit. -i, --help synonym -? --abort-source-on-error abort 'source filename' operations in case of errors --auto-rehash enable automatic rehashing. 1 doesn't need use 'rehash' table , field completion, startup , reconnecting may take longer time. disable --disable-auto-rehash. (defaults on; use --skip-auto-rehash disable.) -a, --no-auto-rehash no automatic rehashing. 1 has use 'rehash' table , field completion. gives quicker start of mysql , disables rehashing on reconnect. --auto-vertical-output automatically switch vertical output mode if result wider terminal width. -b, --batch don't use history file. disable interactive behavior. (enables --silent.) --character-sets-dir=name directory character set files. --column-type-info display column type information. -c, --comments preserve comments. send comments server. default --skip-comments (discard comments), enable --comments. -c, --compress use compression in server/client protocol. -#, --debug[=#] non-debug version. catch , exit. --debug-check check memory , open file usage @ exit. -t, --debug-info print debug info @ exit. -d, --database=name database use. --default-character-set=name set default character set. --delimiter=name delimiter used. -e, --execute=name execute command , quit. (disables --force , history file.) -e, --vertical print output of query (rows) vertically. -f, --force continue if sql error. sets abort-source-on-error 0 -g, --named-commands enable named commands. named commands mean program's internal commands; see mysql> . when enabled, named commands can used line of query, otherwise first line, before enter. disable --disable-named-commands. option disabled default. -i, --ignore-spaces ignore space after function names. --init-command=name sql command execute when connecting mysql server. automatically re-executed when reconnecting. --local-infile enable/disable load data local infile. -b, --no-beep turn off beep on error. -h, --host=name connect host. -h, --html produce html output. -x, --xml produce xml output. --line-numbers write line numbers errors. (defaults on; use --skip-line-numbers disable.) -l, --skip-line-numbers don't write line number errors. -n, --unbuffered flush buffer after each query. --column-names write column names in results. (defaults on; use --skip-column-names disable.) -n, --skip-column-names don't write column names in results. --sigint-ignore ignore sigint (ctrl-c). -o, --one-database ignore statements except occur while default database 1 named @ command line. -p, --password[=name] password use when connecting server. if password not given it's asked tty. -w, --pipe use named pipes connect server. -p, --port=# port number use connection or 0 default to, in order of preference, my.cnf, $mysql_tcp_port, /etc/services, built-in default (3306). --progress-reports progress reports long running commands (like alter table) (defaults on; use --skip-progress-reports disable.) --prompt=name set mysql prompt value. --protocol=name protocol use connection (tcp, socket, pipe, memory). -q, --quick don't cache result, print row row. may slow down server if output suspended. doesn't use history file. -r, --raw write fields without conversion. used --batch. --reconnect reconnect if connection lost. disable --disable-reconnect. option enabled default. (defaults on; use --skip-reconnect disable.) -s, --silent more silent. print results tab separator, each row on new line. --shared-memory-base-name=name base name of shared memory. -s, --socket=name socket file use connection. --ssl enable ssl connection (automatically enabled other flags). --ssl-ca=name ca file in pem format (check openssl docs, implies --ssl). --ssl-capath=name ca directory (check openssl docs, implies --ssl). --ssl-cert=name x509 cert in pem format (implies --ssl). --ssl-cipher=name ssl cipher use (implies --ssl). --ssl-key=name x509 key in pem format (implies --ssl). --ssl-crl=name certificate revocation list (implies --ssl). --ssl-crlpath=name certificate revocation list path (implies --ssl). --ssl-verify-server-cert verify server's "common name" in cert against hostname used when connecting. option disabled default. -t, --table output in table format. --tee=name append outfile. see interactive (\h) also. not work in batch mode. disable --disable-tee. option disabled default. -u, --user=name user login if not current user. -u, --safe-updates allow update , delete uses keys. -u, --i-am-a-dummy synonym option --safe-updates, -u. -v, --verbose write more. (-v -v -v gives table output format). -v, --version output version information , exit. -w, --wait wait , retry if connection down. --connect-timeout=# number of seconds before connection timeout. --max-allowed-packet=# maximum packet length send or receive server. --net-buffer-length=# buffer size tcp/ip , socket communication. --select-limit=# automatic limit select when using --safe-updates. --max-join-size=# automatic limit rows in join when using --safe-updates. --secure-auth refuse client connecting server if uses old (pre-4.1.1) protocol. --server-arg=name send embedded server parameter. --show-warnings show warnings after every statement. --plugin-dir=name directory client-side plugins. --default-auth=name default authentication client-side plugin use. --binary-mode default, ascii '\0' disallowed , '\r\n' translated '\n'. switch turns off both features, , turns off parsing of clientcommands except \c , delimiter, in non-interactive mode (for input piped mysql or loaded using 'source' command). necessary when processing output mysqlbinlog may contain blobs. variables (--variable-name=value) , boolean options {false|true} value (after reading options) --------------------------------- ---------------------------------------- abort-source-on-error false auto-rehash true auto-vertical-output false character-sets-dir (no default value) column-type-info false comments false compress false debug-check false debug-info false database (no default value) default-character-set auto delimiter ; vertical false force false named-commands false ignore-spaces false init-command (no default value) local-infile false no-beep false host (no default value) html false xml false line-numbers true unbuffered false column-names true sigint-ignore false port 3306 progress-reports false prompt \n [\d]> quick false raw false reconnect false shared-memory-base-name (no default value) socket (no default value) ssl false ssl-ca (no default value) ssl-capath (no default value) ssl-cert (no default value) ssl-cipher (no default value) ssl-key (no default value) ssl-crl (no default value) ssl-crlpath (no default value) ssl-verify-server-cert false table false user (no default value) safe-updates false i-am-a-dummy false connect-timeout 0 max-allowed-packet 16777216 net-buffer-length 16384 select-limit 1000 max-join-size 1000000 secure-auth false show-warnings false plugin-dir (no default value) default-auth (no default value) binary-mode false
Comments
Post a Comment