Foros del Web » Programación para mayores de 30 ;) » Bases de Datos General »

restaurar base de datos mysql

Estas en el tema de restaurar base de datos mysql en el foro de Bases de Datos General en Foros del Web. bueno pues asi esta el asunto, exporte mi base de datos y lo hice asi, seleccione todas las tablas y le puse que guardara la ...
  #1 (permalink)  
Antiguo 11/03/2003, 02:15
Avatar de gerzok  
Fecha de Ingreso: diciembre-2002
Ubicación: Zapopan, Jalisco, Mexico
Mensajes: 132
Antigüedad: 21 años, 4 meses
Puntos: 1
Pregunta restaurar base de datos mysql

bueno pues asi esta el asunto, exporte mi base de datos y lo hice asi, seleccione todas las tablas y le puse que guardara la estructura y datos y lo guardara como archivo .sql y todo esto lo hice con el phpmyadmin....

el problema es que a la hora de querer restaurar la base de datos con el archivo (se llama lcentral_foros.sql ) pues se "muere" en el camino y pues ya le quite el tiempo y pues sigue estando muy pesado y no me lo sube (el archivo pesa 8 mb.) y pues me gustaria saber como puedo restaurarla con shell tengo acceso al servidor pero no se nada de shell xDDD o algun programa para "dividir" el fichero y asi subirlo por partes...

de antemano gracias y espero su respuesta.
  #2 (permalink)  
Antiguo 11/03/2003, 02:23
Avatar de Cain  
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 22 años, 3 meses
Puntos: 17
Para bolcar un archivo .sql a una base de datos desde shell (que es más rápido) utiliza:

mysql nombre_de_la_base < nombre_del_archivo


Otra vez, cuando hagas el dump, utiliza esta línea:

mysqldump -opt nombre_de_la_base > nombre_del_archivo

Esto creará un archivo .sql donde los INSERT serán más rápidos.
__________________
M a l d i t o F r i k i
  #3 (permalink)  
Antiguo 11/03/2003, 02:41
Avatar de gerzok  
Fecha de Ingreso: diciembre-2002
Ubicación: Zapopan, Jalisco, Mexico
Mensajes: 132
Antigüedad: 21 años, 4 meses
Puntos: 1
no me sirvio ese comando es que no estoy como root si no como usuario mira el archivo se encuentra en este path

/home/centralj/www/archivo.sql

la base a la que se lo quiero poner es

centralj_foros

y pues no hay un comando con el que espefique el nombre de usuario y pass de la base de datos o el que me dio el server para conectarme al shell que es "alcaida" "bush" xDDD

espero me puedan ayudar, gracias.
  #4 (permalink)  
Antiguo 11/03/2003, 02:44
Avatar de Cain  
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 22 años, 3 meses
Puntos: 17
xDDDD bonita combinación.

Puedes indicar host, user y pass así:

mysql -hhost -uuser -ppass base_de_datos < archivo

Ejemplo:

mysql -hiraq -ubush -palcaida base_de_datos < /home/centralj/www/archivo.sql
__________________
M a l d i t o F r i k i
  #5 (permalink)  
Antiguo 11/03/2003, 03:46
Avatar de gerzok  
Fecha de Ingreso: diciembre-2002
Ubicación: Zapopan, Jalisco, Mexico
Mensajes: 132
Antigüedad: 21 años, 4 meses
Puntos: 1
le puse eso y me salio esto :


mysql: invalid option -- l
mysql Ver 11.18 Distrib 3.23.54, for pc-linux (i686)
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Usage: mysql [OPTIONS] [database]

-?, --help Display this help and exit.
-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 and disables rehashing on reconnect.
-B, --batch Print results with a tab as separator, each row on
a new line. Doesn't use history file.
--character-sets-dir=...
Directory where character sets are located.
-C, --compress Use compression in server/client protocol.
-D, --database=.. Database to use.
--default-character-set=...
Set the default character set.
-e, --execute=... Execute command and quit. (Output like with --batch)
-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. Use \* form only, or
use named commands only in the beginning of a line
ending with a semicolon (;) Since version 10.9 the
client now starts with this option ENABLED by
default! Disable with '-G'. Long format commands
still work from the first line.
-G, --enable-named-commands
Named commands are enabled. Opposite to -g.
-i, --ignore-spaces Ignore spaces after function names.
-h, --host=... Connect to host.
-H, --html Produce HTML output.
--local-infile=[1|0] Enable/disable LOAD DATA LOCAL INFILE
-L, --skip-line-numbers
Don't write line number for errors.
--no-pager Disable pager and print to stdout. See interactive
help (\h) also.
--no-tee Disable outfile. See interactive help (\h) also.
-n, --unbuffered Flush buffer after each query.
-N, --skip-column-names
Don't write column names in results.
-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.
--pager[=...] Pager to use to display results. If you don't supply
an option the default pager is taken from your ENV
variable PAGER ().
Valid pagers are less, more, cat [> filename], etc.
See interactive help (\h) also. This option does
not work in batch mode.
-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.
-S --socket=... Socket file to use for connection.
-t, --table Output in table format.
-T, --debug-info Print some debug info at exit.
--tee=... Append everything into outfile. See interactive help
(\h) also. Does not work in batch mode.
-u, --user=# 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.

Default options are read from the following files in the given order:
/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--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

Possible variables for option --set-variable (-O) are:
connect_timeout current value: 0
max_allowed_packet current value: 16777216
net_buffer_length current value: 16384
select_limit current value: 1000
max_join_size current value: 1000000
bash-2.05a$
  #6 (permalink)  
Antiguo 11/03/2003, 04:03
Avatar de Cain  
Fecha de Ingreso: enero-2002
Ubicación: Catalunya
Mensajes: 6.459
Antigüedad: 22 años, 3 meses
Puntos: 17
Vuelve a copiar la línea y verifica que pones bien los datos, en el error que pegas dice que has intentado poner el argumento -l y yo no he dicho nada de poner -l en ningún sitio
__________________
M a l d i t o F r i k i
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:00.