Base de Datos
- Introduccion
- Tutorial Lenguaje SQL
- Notas sobre Lenguaje SQL
- Teoría de las Bases de Datos
- Herramientas
Ruta: >Base de Datos
MySQL, crea en el directorio de instalación ej.: f:\BaseDatos\mysql\data
Si se desea también puede instalarse PHPMyAdmin para gestionar las bases de datos MySQL a traves de la web.
Operación | Comando (linux) | Comando (Windows) |
---|---|---|
Crear base de datos | mysqladmin -p create BASEDEDATOS | |
Eliminar base de datos | mysqladmin -p drop BASEDEDATOS | |
- | - |
Operación | Comando (linux) | Comando (Windows) |
---|---|---|
Arrancar el servidor | safe_mysqld & | winmysqladmin, mysqld-nt o mysqld |
Parar el servidor | mysqladmin -p shutdown | mysqladmin shutdown |
Reiniciar el servidor | mysqld | |
Ejecutar archivo script | mysql -p </RutaAlArchivo/Archivo.sql |
Operación | Comando |
---|---|
Entrar a la consola de MySQL | mysql |
Entrar a la consola de MySQL como el usuario usuario | mysql -u usuario -p |
Salir de la consola de MySQL | \q |
Ayuda de la consola (hay que estar en ella) | \help o \h |
Operación | Comando |
---|---|
Crear base de datos | create database basededatos ; |
Eliminar base de datos | drop database basededatos ; |
Mostrar las bases de datos disponibles | show databases ; |
Trabajar sobre con una base de datos | use basededatos ; |
Operación | Comando |
---|---|
Mostrar tablas de la BD | show tables from basededatos ; |
Muestra los campos de la tabla | show columns from tabla ; o describe tabla ; |
Crear tabla | create table nombretabla (columna1 tipodato, columna2 tipodato...) ; |
Crear tabla temporal | create temporary table nombretabla (columna1 tipodato); |
Crear tabla verificando que no existe | create table inf not exists nombretabla (columna1 tipodato, columna2 tipodato...) ; |
Eliminar tabla | drop table nombretabla ; |
Editar tabla | alter table nombretabla operacion ; |
Cambiar nombre a tabla | alter table nombretablaviejo rename nombretablanuevo; |
Bloquea tabla | lock nombretabla1, nombretabla2... ; |
Desbloquea tabla | unlock nombretabla1 READ|WRITE, nombretabla2 READ|WRITE... ; |
- | - |
Operación | Comando |
---|---|
Añadir columna | alter table nombretabla ADD nombrecolumna tipodato; |
Cambia el tipo de dato de la columna | alter table nombretabla change nombrecolumna nombrecolumna nuevotipodato; |
Cambiar el nombre de la columna | alter table nombretabla change nombrecolumnaviejo nombrecolumnanuevo tipodato; |
Eliminar columna | alter table nombretabla drop nombrecolumna; |
Añadir índice a columna |
create index nombreíndice on nombretabla (nombrecolumna1,...); ó alter table nombretabla add index (nombrecolumna); |
Añadir campo clave (key) |
create primary key on nombretabla
(nombrecolumna1,...); ó alter table nombretabla add primary key (nombrecolumna); |
Eliminar campo clave (key) | alter table nombretabla drop primary key; |
Operación | Comando |
---|---|
Insertar nuevo dato en tabla | insert into nombretabla values (valorcampo1,'valorcampo2',valorcampo3...); |
Importar archivo de datos a tabla | load data infile 'archivo.txt' into table nombretabla; |
Seleccionar datos de una tabla | select nombrecampo1, nombrecampo2... from nombretabla where condición |
Borrar todos los datos de una tabla (conserva la tabla con sus campos) | delete from nombretabla; |
Actualizar un dato del campo1 | update nombretabla SET nombrecampo1='nuevovalorcampo' WHERE nombrecampo2='valorcampo2'; |
Contar registros que cumplen un criterio | select count(campos) from nombretabla; |
Operación | Comando |
---|---|
Crear índice | create index nombreindice on nombretabla(listanombrescolumnas); |
Elimina índice | drop index indexname on tablename; o alter table nombretabla drop index nombreindice; |
Mostrar claves | show keys from nombretabla ; o show index from nombretabla; |
A los tipos numéricos se les pueden aplicar modificadores de columna: UNSIGNED, AUTO_INCREMENT y ZEROFILL.
Tipo | Bytes de memoria | Rango de valores | 'Unsigned' (solo valores +) |
---|---|---|---|
TINYINT | 1 | -128 a 127 | 0-255 |
SMALLINT | 2 | -32768 a 32767 | 0-65535 |
MEDIUMINT | 3 | -8388608 a 8388607 | 0-16777215 |
INT | 4 | -2147483648 a 2147483647 | 0-4294967295 |
BIGINT | 8 | -9223372036854775808 a 9223372036854775807 | 0-18446744073709550615 |
FLOAT(M,D) | 4 | Varía según el valor | |
DOUBLE(M,D) | 8 | Varía según el valor | |
DECIMAL(M,D) | M + 2 bytes | Varía según el valor |
Sus valores siempre van entre 'comillas'.
A los estos tipos se les pueden aplicar modificadores de columna.
Tipo | Tamaño max | Espacio de almacenamiento | Descripción |
---|---|---|---|
CHAR(tamaño) | 255 bytes | tamaño bytes | Tamaño fijo: siempre se ocupan los X caracteres. |
VARCHAR(tamaño) | 255 bytes | tamaño + 1 bytes | Tamaño variable: se ocupan los caracteres introducidos + 1 |
TINYTEXT | 255 bytes | tamaño + 1 bytes | |
TINYBLOB | 255 bytes | tamaño + 2 bytes | |
TEXT | 65535 bytes | tamaño + 2 bytes | Para guardar imágenes, documentos, mucho texto... |
BLOB | 65535 bytes | tamaño + 2 bytes | Para guardar imágenes, documentos, mucho texto... |
MEDIUMTEXT | 1.6 MB. | tamaño + 3 bytes | |
MEDIUMBLOB | 1.6 MB. | tamaño + 3 bytes | |
LONGTEXT | 4.2 GB. | tamaño + 4 bytes | |
LONGBLOB | 4.2 GB. | tamaño + 4 bytes |
Tipo | Descripción | Comentario | Ejemplo |
---|---|---|---|
DATE | Fecha (formato aaaa-mm-dd) | Debe especificarse entre comillas 'valor' | '2000-01-01' |
ENUM | Lista enumerada: solo puede contener los valores indicados. El campo solo puede contener uno de ellos. | Permite 65535 elementos* | CREATE TABLE Personas (Sexo ENUM('Hombre','Mujer'),Raza ENUM('Negra,'Blanca')); |
SET | Lista enumerada: solo puede contener los valores indicados. El campo solo puede contener más de un valor. | Permite 64 elementos* | CREATE Table Medio(Formato SET('Web','TV','Radio')); |
Ej: base de datos de un zoológico.
Puedes crear un fichero de texto 'animal.txt' conteniendo un registro por línea, con valores separados por tabuladores, y dados en el orden en el que las columnas fueron listadas en la sentencia CREATE TABLE.
nombre propietarioespeciesexonacimientomuerte
FluffyHaroldgatof1993-02-04
ClawsGwengatom1994-03-17
BuffyHaroldperrof1989-05-13
FangBennyperrom1990-08-27
BowserDianeperrom1998-08-311995-07-29
ChirpyGwenpájarof1998-09-11
Whistler Gwenpájaro1997-12-09
SlimBennyserpientem1996-04-29
Whistler Gwen pájaro
\N1997-12-09\N
LOAD DATA INFILE 'animal.txt' INTO TABLE mascotas;
Estructura carpetas: C:\MySQL\Data\Mascotas
LOAD DATA INFILE 'animal.txt' INTO TABLE mascotas; (Busca el archivo en la carpeta Mascotas)
LOAD DATA INFILE './animal.txt' INTO TABLE mascotas; (Busca el archivo en la carpeta DATA)
LOAD DATA INFILE './../animal.txt' INTO TABLE mascotas; (Busca el archivo en la carpeta MySQL)
LOAD DATA INFILE './../../animal.txt' INTO TABLE mascotas; (Busca el archivo en la carpeta C:)
Modificador | Descripción | Se aplica a |
---|---|---|
UNSIGNED | No permite números negativos | Numéricos |
AUTO_INCREMENT | Al introducir un nuevo registro, en esta columna se introduce el valor que tenia el registro anterior + 1 | Tipos INT |
ZEROFILL | Se ponen ceros a la izquierda del valor hasta completar el campo Ej: Introducimos 23 en un campo INT(5) y en el campo se pone 00023 | Numéricos |
BINARY | Se tratan como cadenas binarias, es decir, que es 'case sensitive' (distingue mayúsculas de minúsculas). | CHAR, VAR |
DEFAULT | Permite definir el valor por defecto de una columna si este
no existe.Ej: CREATE TABLE Destinos(Ciudad char(2) NOT NULL DEFAULT 'NY'); Los registros vacios o con valor NULL en el campo Ciudad tendrán el valor por defecto NY (Nueva York). |
Todos excepto BLOB y TEXT |
NOT NULL | No se permiten registros vacíos en esa columna. | Todos |
NULL | Se permiten registros vacíos en esa columna. | Todos |
PRIMARY KEY | Índice de valores únicos. Dichos campos no pueden estar vacíos. Cada tabla debería tener uno. | Todos |
UNIQUE | Los valores de esa tabla no pueden repetirse. | Todo |
Field | Type | Null | Key | Default | Extra |
---|---|---|---|---|---|
ID | INT(11) | PRI | NULL | Auto increment | |
Nombre | VARCHAR(20) | YES | NULL | ||
Apellido | VARCHAR(20) | YES | NULL |
ID | Nombre | Apellido |
---|---|---|
1 | Juan | Martín |
2 | Pedro | Santos |
3 | María | Plata |
Ej: CREATE TEMPORARY TABLE SELECT * FROM Customers ;
Operaciones disponibles | Descripción | Ejemplo |
---|---|---|
ADD [COLUMN] create_definition [FIRST | AFTER column_name ] | ||
ADD [COLUMN] (create_definition, create_definition,...) | ||
ADD INDEX [index_name] (index_col_name,...) | ||
ADD PRIMARY KEY (index_col_name,...) | ||
ADD UNIQUE [index_name] (index_col_name,...) | ||
ADD FULLTEXT [index_name] (index_col_name,...) | ||
ADD [CONSTRAINT symbol] FOREIGN KEY index_name (index_col_name,...) [reference_definition] | ||
ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT} | ||
CHANGE [COLUMN] old_col_name create_definition [FIRST | AFTER column_name] | ||
MODIFY [COLUMN] create_definition [FIRST | AFTER column_name] | ||
DROP PRIMARY KEY | ||
DROP INDEX index_name | ||
DISABLE KEYS | ||
ENABLE KEYS | ||
ORDER BY col | ||
table_options |
(Ha de revisarse esta información)
CREATE INDEX nombreindice ON nombretabla (listanombrescolumnas);
ALTER TABLE nombretabla ADD INDEX nombrecolumna);
Los pasos a seguir son:
Algunos consejos antes de importar los datos:
Por ejemplo: Crear una base de datos con una tabla. En dicha tabla introducimos una fila de datos:
Caracter | Descripción | Ejemplo | Resultado |
---|---|---|---|
'%' | Cualquier número variable de caracteres | SELECT * FROM clientes WHERE nombre LIKE 'Pe%'; | Pedro, Pepe, Penélope... |
'_' | Cualquier carácter único | SELECT * FROM clientes WHERE nombre LIKE 'Pep_n'; | Pepín, Pepón |
'.' | Cualquier carácter único | SELECT * FROM clientes WHERE nombre LIKE 'To..'; | Tony, Toto |
'[abG]' | Cadenas que contienen los carateres especificados entre corchetes: a, b, y G (Sin incluir A, B y g) (Se debe usar REGEXP en el SQL) | SELECT * FROM clientes WHERE nombre REGEXP '[abG]'; | Juan, Gilda, Toby |
'[a-d]' | Cadenas que contienen el rango de caracteres contenidos en los cochetes: a, b, c y d (Sin incluir A, B, C y D) (Se debe usar REGEXP en el SQL) | SELECT * FROM clientes WHERE nombre REGEXP '[a-d]'; | Juan, Toby, Nacho, Fido |
'*' | Cualquier conjunto de caracteres | SELECT * FROM clientes | (Lista completa de nombres) |
'^B' | Palabras que comiencen con B (Se debe usar REGEXP en el SQL) | SELECT * FROM clientes WHERE nombre
REGEXP '^[bB]'; |
Bob, Bilma, bulba, beatriz |
'n$' | Palabras que terminen con n (Se debe usar REGEXP en el SQL) | SELECT * FROM clientes WHERE nombre
REGEXP 'n$'; |
Ramón, Simón, John |
mysqldump nombreBD > nombreBD.txt
mysql < nombreBD.txt
Usuarios
Acción | servidor | Usuario | Contraseña | Privilegios | ||
---|---|---|---|---|---|---|
Editar | Borrar | Permisos | % | cualquiera | No | Sin Privilegios |
Editar | Borrar | Permisos | % | root | No | Select Insert Update Delete Create Drop Reload Shutdown Process File Grant References Index Alter |
Editar | Borrar | Permisos | localhost | cualquiera | No | Select Insert Update Delete Create Drop Reload Shutdown Process File Grant References Index Alter |
Editar | Borrar | Permisos | localhost | administrador | Si | Select Insert Update Delete Create Drop Reload Shutdown Process File Grant References Index Alter |
Editar | Borrar | Permisos | localhost | root | No | Select Insert Update Delete Create Drop Reload Shutdown Process File Grant References Index Alter |
Editar | Borrar | Permisos | localhost | usuario | Si | Select Insert Update Delete Create Drop Reload Shutdown Process File Grant References Index Alter |
Debemos borrar los usuarios más críticos para la seguridad de la base de datos.
<nombretabla1>
<nombrecampo1>dato1</nombrecampo1>
<nombrecampo2>dato1</nombrecampo2>
<nombrecampo3>dato1</nombrecampo3>
<nombrecampo1>dato2</nombrecampo1>
<nombrecampo2>dato2</nombrecampo2>
<nombrecampo3>dato2</nombrecampo3>
</nombretabla1>
<nombretabla2>
...
</nombretabla2>
...
*NOTA: En la versión 3.23.49 de Windows parece que hay un bug en mysqldump que hace que al exportar a XML, los tags de cierre de campos de tipo numérico son los únicos que se crean convenientemente. Los tag de cierre de campos de tipo texto no se cierran correctamente. Por ejemplo:
<Titulo>Mistaken identity<Titulo> <Ano>1996</Ano> <Original>-1</Original> <Presentacion>Caja<Presentacion> <Prestado>0</Prestado> <Persona><Persona> <CDAudio>-1</CDAudio> <Frecuencia>0</Frecuencia> <Bits>0</Bits> <Ident>1</Ident>
Sin embargo podemos exportar fácilmente y de manera correcta los datos a XML si tenemos instalado el GUI (phpmyadmin/exp_xml.htm)PHPMyAdmin.
<?php /* $Id: config.inc.php,v 1.110 2002/06/19 13:11:38 rabus Exp $ */ /** * phpMyAdmin Configuration File * * All directives are explained in Documentation.html */ /** * Sets the php error reporting - Please do not change this line! */ $old_error_rep = error_reporting(E_ALL); /** * Your phpMyAdmin url * * Complete the variable below with the full url ie * http://www.your_web.net/path_to_your_phpMyAdmin_directory/ * * It must contain characters that are valid for a URL, and the path is * case sensitive on some Web servers, for example Unix-based servers. */ $cfg['PmaAbsoluteUri'] = '; /** * Server(s) configuration */ $i = 0; // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0]. // You can disable a server config entry by setting host to '. $i++; $cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname $cfg['Servers'][$i]['port'] = '; // MySQL port - leave blank for default port $cfg['Servers'][$i]['socket'] = '; // Path to the socket - leave blank for default socket $cfg['Servers'][$i]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket') $cfg['Servers'][$i]['controluser'] = '; // MySQL control user settings // (this user must have read-only $cfg['Servers'][$i]['controlpass'] = '; // access to the 'mysql/user' // and 'mysql/db' tables) $cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)? $cfg['Servers'][$i]['user'] = 'root'; // MySQL user $cfg['Servers'][$i]['password'] = '; // MySQL password (only needed // with 'config' auth_type) $cfg['Servers'][$i]['only_db'] = '; // If set to a db-name, only // this db is displayed // at left frame // It may also be an array // of db-names $cfg['Servers'][$i]['verbose'] = '; // Verbose name for this host - leave blank to show the hostname $cfg['Servers'][$i]['pmadb'] = '; // Database used for Relation, Bookmark and PDF Features // - leave blank for no support $cfg['Servers'][$i]['bookmarktable'] = '; // Bookmark table - leave blank for no bookmark support $cfg['Servers'][$i]['relation'] = '; // table to describe the relation between links (see doc) // - leave blank for no relation-links support $cfg['Servers'][$i]['table_info'] = '; // table to describe the display fields // - leave blank for no display fields support $cfg['Servers'][$i]['table_coords'] = '; // table to describe the tables position for the PDF // schema - leave blank for no PDF schema support $cfg['Servers'][$i]['column_comments'] // table to store columncomments = '; // - leave blank if you don't want to use this $cfg['Servers'][$i]['pdf_pages'] = '; // table to describe pages of relationpdf $cfg['Servers'][$i]['AllowDeny']['order'] // Host authentication order, leave blank to not use = '; $cfg['Servers'][$i]['AllowDeny']['rules'] // Host authentication rules, leave blank for defaults = array(); $i++; $cfg['Servers'][$i]['host'] = '; $cfg['Servers'][$i]['port'] = '; $cfg['Servers'][$i]['socket'] = '; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['controluser'] = '; $cfg['Servers'][$i]['controlpass'] = '; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = '; $cfg['Servers'][$i]['only_db'] = '; $cfg['Servers'][$i]['verbose'] = '; $cfg['Servers'][$i]['pmadb'] = '; $cfg['Servers'][$i]['bookmarktable'] = '; $cfg['Servers'][$i]['relation'] = '; $cfg['Servers'][$i]['table_info'] = '; $cfg['Servers'][$i]['table_coords'] = '; $cfg['Servers'][$i]['column_comments'] ='; $cfg['Servers'][$i]['pdf_pages'] = '; $cfg['Servers'][$i]['AllowDeny']['order'] = '; $cfg['Servers'][$i]['AllowDeny']['rules'] = array(); $i++; $cfg['Servers'][$i]['host'] = '; $cfg['Servers'][$i]['port'] = '; $cfg['Servers'][$i]['socket'] = '; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['controluser'] = '; $cfg['Servers'][$i]['controlpass'] = '; $cfg['Servers'][$i]['auth_type'] = 'config'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = '; $cfg['Servers'][$i]['only_db'] = '; $cfg['Servers'][$i]['verbose'] = '; $cfg['Servers'][$i]['pmadb'] = '; $cfg['Servers'][$i]['bookmarktable'] = '; $cfg['Servers'][$i]['relation'] = '; $cfg['Servers'][$i]['table_info'] = '; $cfg['Servers'][$i]['table_coords'] = '; $cfg['Servers'][$i]['column_comments'] ='; $cfg['Servers'][$i]['pdf_pages'] = '; $cfg['Servers'][$i]['AllowDeny']['order'] = '; $cfg['Servers'][$i]['AllowDeny']['rules'] = array(); // If you have more than one server configured, you can set $cfg['ServerDefault'] // to any one of them to autoconnect to that server when phpMyAdmin is started, // or set it to 0 to be given a list of servers without logging in // If you have only one server configured, $cfg['ServerDefault'] *MUST* be // set to that server. $cfg['ServerDefault'] = 1; // Default server (0 = no default server) $cfg['Server'] = '; unset($cfg['Servers'][0]); /** * Other core phpMyAdmin settings */ $cfg['OBGzip'] = TRUE; // use GZIP output buffering if possible $cfg['PersistentConnections'] = FALSE; // use persistent connections to MySQL database $cfg['ExecTimeLimit'] = 300; // maximum execution time in seconds (0 for no limit) $cfg['SkipLockedTables'] = FALSE; // mark used tables, make possible to show // locked tables (since MySQL 3.23.30) $cfg['ShowSQL'] = TRUE; // show SQL queries as run $cfg['AllowUserDropDatabase'] = FALSE; // show a 'Drop database' link to normal users $cfg['Confirm'] = TRUE; // confirm 'DROP TABLE' & 'DROP DATABASE' $cfg['LoginCookieRecall'] = TRUE; // recall previous login in cookie auth. mode or not $cfg['UseDbSearch'] = TRUE; // whether to enable the 'database search' feature // or not // Left frame setup $cfg['LeftFrameLight'] = TRUE; // use a select-based menu and display only the // current tables in the left frame. $cfg['ShowTooltip'] = TRUE; // display table comment as tooltip in left frame // In the main frame, at startup... $cfg['ShowStats'] = TRUE; // allow to display statistics and space usage in // the pages about database details and table // properties $cfg['ShowMysqlInfo'] = FALSE; // whether to display the 'MySQL runtime $cfg['ShowMysqlVars'] = FALSE; // information', 'MySQL system variables', 'PHP $cfg['ShowPhpInfo'] = FALSE; // information' and 'change password' links for $cfg['ShowChgPassword'] = FALSE; // simple users or not // In browse mode... $cfg['ShowBlob'] = FALSE; // display blob field contents $cfg['NavigationBarIconic'] = TRUE; // do not display text inside navigation bar buttons $cfg['ShowAll'] = FALSE; // allows to display all the rows $cfg['MaxRows'] = 30; // maximum number of rows to display $cfg['Order'] = 'ASC'; // default for 'ORDER BY' clause (valid // values are 'ASC', 'DESC' or 'SMART' -ie // descending order for fields of type // TIME, DATE, DATETIME & TIMESTAMP, // ascending order else-) // In edit mode... $cfg['ProtectBinary'] = 'blob'; // disallow editing of binary fields // valid values are: // FALSE allow editing // 'blob' allow editing except for BLOB fields // 'all' disallow editing $cfg['ShowFunctionFields'] = TRUE; // Display the function fields in edit/insert mode // For the export features... $cfg['ZipDump'] = TRUE; // Allow the use of zip/gzip/bzip $cfg['GZipDump'] = TRUE; // compression for $cfg['BZipDump'] = TRUE; // dump files /** * Link to the official MySQL documentation * Be sure to include no trailing slash on the path */ $cfg['ManualBaseShort'] = 'http://www.mysql.com/doc'; /** * Language settings */ // Default language to use, if not browser-defined or user-defined $cfg['DefaultLang'] = 'en'; /** * Charset conversion settings */ // Default charset to use for recoding of MySQL queries, does not take // any effect when charsets recoding is switched off by // $cfg['AllowAnywhereRecoding'] or in language file // (see $cfg['AvailableCharsets'] to possible choices, you can add your own) $cfg['DefaultCharset'] = 'iso-8859-1'; // Allow charset recoding of MySQL queries, must be also enabled in language // file to make harder using other language files than unicode. $cfg['AllowAnywhereRecoding'] = TRUE; // Force: always use this language - must be defined in // libraries/select_lang.lib.php // $cfg['Lang'] = 'en'; // Loads language file require('./libraries/select_lang.lib.php'); /** * Customization & design */ $cfg['LeftWidth'] = 150; // left frame width $cfg['LeftBgColor'] = '#D0DCE0'; // background color for the left frame $cfg['LeftPointerColor'] = '#CCFFCC'; // color of the pointer in left frame // (blank for no pointer) $cfg['RightBgColor'] = '#F5F5F5'; // background color for the right frame $cfg['RightBgImage'] = '; // path to a background image for the right frame // (leave blank for no background image) $cfg['Border'] = 0; // border width on tables $cfg['ThBgcolor'] = '#D3DCE3'; // table header row colour $cfg['BgcolorOne'] = '#CCCCCC'; // table data row colour $cfg['BgcolorTwo'] = '#DDDDDD'; // table data row colour, alternate $cfg['BrowsePointerColor'] = '#CCFFCC'; // color of the pointer in browse mode // (blank for no pointer) $cfg['BrowseMarkerColor'] = '#FFCC99'; // color of the marker (visually marks row // by clicking on it) in browse mode // (blank for no marker) $cfg['TextareaCols'] = 40; // textarea size (columns) in edit mode // (this value will be emphasized (*2) for sql // query textareas) $cfg['TextareaRows'] = 7; // textarea size (rows) in edit mode $cfg['LimitChars'] = 50; // max field data length in browse mode $cfg['ModifyDeleteAtLeft'] = TRUE; // show edit/delete links on left side of browse // (or at the top with vertical browse) $cfg['ModifyDeleteAtRight'] = FALSE; // show edit/delete links on right side of browse // (or at the bottom with vertical browse) $cfg['DefaultDisplay'] = 'horizontal'; // default display direction (horizontal|vertical) $cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate) $cfg['UseSyntaxColoring'] = TRUE; // use syntaxcoloring on output of SQL, might be a little slower $cfg['colorFunctions'] = '#FF0000'; // Colors used for Syntaxcoloring of SQL Statements $cfg['colorKeywords'] = '#990099'; $cfg['colorStrings'] = '#008000'; $cfg['colorColType'] = '#FF9900'; $cfg['colorAdd'] = '#0000FF'; /** * Available charsets for MySQL conversion. currently contains all which could * be found in lang/* files and few more. * * Charsets will be shown in same order as here listed, so if you frequently * use some of these move them to the top. */ $cfg['AvailableCharsets'] = array( 'iso-8859-1', 'iso-8859-2', 'iso-8859-3', 'iso-8859-4', 'iso-8859-5', 'iso-8859-6', 'iso-8859-7', 'iso-8859-8', 'iso-8859-9', 'iso-8859-10', 'iso-8859-11', 'iso-8859-12', 'iso-8859-13', 'iso-8859-14', 'iso-8859-15', 'windows-1250', 'windows-1251', 'windows-1252', 'windows-1257', 'koi8-r', 'big5', 'gb2312', 'utf-8', 'utf-7', 'x-user-defined', 'euc-jp', 'ks_c_5601-1987', 'tis-620', 'SHIFT_JIS' ); /** * MySQL settings */ // Column types; // varchar, tinyint, text and date are listed first, based on estimated popularity $cfg['ColumnTypes'] = array( 'VARCHAR', 'TINYINT', 'TEXT', 'DATE', 'SMALLINT', 'MEDIUMINT', 'INT', 'BIGINT', 'FLOAT', 'DOUBLE', 'DECIMAL', 'DATETIME', 'TIMESTAMP', 'TIME', 'YEAR', 'CHAR', 'TINYBLOB', 'TINYTEXT', 'BLOB', 'MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'ENUM', 'SET' ); // Atributes $cfg['AttributeTypes'] = array( ', 'BINARY', 'UNSIGNED', 'UNSIGNED ZEROFILL' ); // Available functions if ($cfg['ShowFunctionFields']) { $cfg['Functions'] = array( 'ASCII', 'CHAR', 'SOUNDEX', 'LCASE', 'UCASE', 'NOW', 'PASSWORD', 'MD5', 'ENCRYPT', 'RAND', 'LAST_INSERT_ID', 'COUNT', 'AVG', 'SUM', 'CURDATE', 'CURTIME', 'FROM_DAYS', 'FROM_UNIXTIME', 'PERIOD_ADD', 'PERIOD_DIFF', 'TO_DAYS', 'UNIX_TIMESTAMP', 'USER', 'WEEKDAY', 'CONCAT' ); } // end if if($cfg['UseSyntaxColoring']) { $cfg['keywords']=array( 'SELECT', 'INSERT', 'LEFT', 'INNER', 'UPDATE', 'REPLACE', 'EXPLAIN', 'FROM', 'WHERE', 'LIMIT', 'INTO', 'ALTER', 'ADD', 'DROP', 'GROUP', 'ORDER', 'CHANGE', 'CREATE', 'DELETE', 'VALUES' ); } // end if if($cfg['UseSyntaxColoring']) { $cfg['additional']=array( 'TABLE', 'DEFAULT', 'NULL', 'NOT', 'INDEX', 'PRIMARY', 'KEY', 'UNIQUE', 'BINARY', 'UNSIGNED', 'ZEROFILL', 'AUTO_INCREMENT', 'AND', 'OR', 'DISTINCT', 'DISTINCTROW', 'BY', 'ON', 'JOIN', 'BETWEEN', 'IN', 'IF', 'ELSE', 'SET' ); } /** * Unset magic_quotes_runtime - do not change! */ set_magic_quotes_runtime(0); /** * Restore old error_reporting mode - do not change either! */ error_reporting($old_error_rep); unset($old_error_rep); /** * File Revision - do not change either! */ $cfg['FileRevision'] = '$Revision: 1.110 $'; /* Línea que indica la ubicacion * de la carpeta de phpmyadmin * en el servidor web */ $cfg['PmaAbsoluteUri'] = 'http://localhost/phpMyAdmin/'; ?>
Nombre | Descripción | Ejemplo |
---|---|---|
mysqlimport | Permite importar datos a MySQL desde archivos de texto | |
mysqldump | Permite exportar datos de MySQL a un archivo de texto (incluye las sentencias SQL para facilitar la importación desde MySQL). Hace una replica completa de la base de datos. También permite hacer la Exportar datos a XML. | mysqldump nombreBD > nombreBD.txt |
Página generada automáticamente desde la Base de Datos: BDatosVarios/ el 27/5/2008 19:49:22