SlideShare una empresa de Scribd logo
1 de 9
Descargar para leer sin conexión
Instalar MySQL CentOS | Moisés Araya
[1]
Instalar MySQL 5.1 en CentOS 6.4x64
A continuación se presenta una guía básica donde se muestra la instalación, configuración y algunas
tareas básicas de uso de MySQL en un servidor Linux.
Procedimiento.
Instalar librerías.
[root@centos ~]# yum -y install mysql-server
Installed:
mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency Installed:
make.x86_64 1:3.81-20.el6 mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64
0:4.013-3.el6
perl-DBI.x86_64 0:1.609-4.el6
Dependency Updated:
mysql-libs.x86_64 0:5.1.73-3.el6_5 openssl.x86_64 0:1.0.1e-30.el6_6.4
Complete!
[root@centos ~]#
Editar archivo de configuración y agregar set de caracteres utf8 (útil para caracteres acentuados).
[root@centos ~]# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server=utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
Iniciar MySQL.
[root@centos ~]# /etc/rc.d/init.d/mysqld start
Iniciando base de datos MySQL: WARNING: The host 'centos.lab' could not be looked up with
resolveip.
This probably means that your libc libraries are not 100 % compatible
with this binary MySQL version. The MySQL daemon, mysqld, should work
normally with the exception that host name resolving will not work.
This means that you should use IP addresses instead of hostnames
when specifying MySQL privileges !
Installing MySQL system tables...
OK
Instalar MySQL CentOS | Moisés Araya
[2]
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h centos.lab password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Iniciando mysqld: [ OK ]
Configurar inicio de servicio.
[root@centos ~]# chkconfig mysqld on
Configuración segura de MySQL.
 Seteo de contraseña de usuario root.
 Eliminar usuarios anónimos.
 Deshabilitar el acceso remoto de root
 Eliminar las bases de datos de test
Instalar MySQL CentOS | Moisés Araya
[3]
[root@centos ~]# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] y
... Success!
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Instalar MySQL CentOS | Moisés Araya
[4]
Conectarse a MySQL.
[root@centos ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 10
Server version: 5.1.73 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql>
Mostrar usuarios/DB y salir.
mysql> select user,host,password from mysql.user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | 127.0.0.1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+-----------+-------------------------------------------+
2 rows in set (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
mysql> exit
Bye
[root@centos ~]#
Revisar version
mysql> select version(), current_date;
+-----------+--------------+
| version() | current_date |
+-----------+--------------+
| 5.1.73 | 2014-11-24 |
+-----------+--------------+
1 row in set (0.03 sec)
Instalar MySQL CentOS | Moisés Araya
[5]
Crear DB y mostrar DB existentes.
mysql> create database usuarios;
Query OK, 1 row affected (0.00 sec)
mysql> use usuarios
Database changed
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| usuarios |
+--------------------+
3 rows in set (0.00 sec)
Seleccionar Base de datos.
mysql> use mysql;
Database changed
Crear tablas/Mostrar tablas.
mysql> show tables;
Empty set (0.00 sec)
mysql> CREATE TABLE administracion (nombre VARCHAR(20), apellido VARCHAR(20), cargo
VARCHAR(20), ingreso DATE);
Query OK, 0 rows affected (0.08 sec)
mysql> show tables;
+--------------------+
| Tables_in_usuarios |
+--------------------+
| administracion |
+--------------------+
1 row in set (0.00 sec)
Mostrar la estructura de la tabla creada,
mysql> describe administracion;
+----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+-------------+------+-----+---------+-------+
| nombre | varchar(20) | YES | | NULL | |
| apellido | varchar(20) | YES | | NULL | |
| cargo | varchar(20) | YES | | NULL | |
| ingreso | date | YES | | NULL | |
+----------+-------------+------+-----+---------+-------+
Instalar MySQL CentOS | Moisés Araya
[6]
Cargar datos en la DB.
mysql> INSERT INTO administracion VALUES ('David','Errazuriz','Ingeniero','2014-01-01');
Query OK, 1 row affected (0.00 sec)
Obtener información de la tabla modificada.
mysql> SELECT * FROM administracion;
+--------+-----------+-----------+------------+
| nombre | apellido | cargo | ingreso |
+--------+-----------+-----------+------------+
| David | Errazuriz | Ingeniero | 2014-01-01 |
+--------+-----------+-----------+------------+
1 row in set (0.00 sec)
Borrar datos de la tabla.
mysql> DELETE FROM administracion;
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM administracion;
Empty set (0.00 sec)
Actualizar algún registro.
mysql> UPDATE administracion SET cargo="gerente"
-> WHERE nombre="David";
Query OK, 1 row affected (0.04 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> SELECT * FROM administracion;
+--------+-----------+---------+------------+
| nombre | apellido | cargo | ingreso |
+--------+-----------+---------+------------+
| David | Errazuriz | gerente | 2014-01-01 |
+--------+-----------+---------+------------+
1 row in set (0.00 sec)
Buscar información en una tabla.
Para esto se han añadido tres registros a la tabla.
mysql> SELECT * FROM administracion;
+---------+-----------+-----------+------------+
| nombre | apellido | cargo | ingreso |
+---------+-----------+-----------+------------+
| David | Errazuriz | Ingeniero | 2014-01-01 |
| Arturo | Gonzalez | Gerente | 2014-03-09 |
| Gonzalo | Perez | Soporte | 2013-03-09 |
+---------+-----------+-----------+------------+
Instalar MySQL CentOS | Moisés Araya
[7]
mysql> SELECT * FROM administracion WHERE nombre='Arturo';
+--------+----------+---------+------------+
| nombre | apellido | cargo | ingreso |
+--------+----------+---------+------------+
| Arturo | Gonzalez | Gerente | 2014-03-09 |
+--------+----------+---------+------------+
1 row in set (0.00 sec)
Búsqueda compuesta
mysql> SELECT * FROM administracion WHERE cargo='Ingeniero' AND nombre='David';
+--------+-----------+-----------+------------+
| nombre | apellido | cargo | ingreso |
+--------+-----------+-----------+------------+
| David | Errazuriz | Ingeniero | 2014-01-01 |
+--------+-----------+-----------+------------+
1 row in set (0.00 sec)
Seleccionar solo algunos campos
mysql> SELECT nombre, cargo FROM administracion;
+---------+-----------+
| nombre | cargo |
+---------+-----------+
| David | Ingeniero |
| Arturo | Gerente |
| Gonzalo | Soporte |
+---------+-----------+
3 rows in set (0.00 sec)
Ordenar resultados
mysql> SELECT nombre FROM administracion ORDER BY ingreso;
+---------+
| nombre |
+---------+
| Gonzalo |
| David |
| Arturo |
+---------+
Respaldar y restaurar
Respaldar.
[root@centos ~]# mysqldump -u root -proot usuarios > dump_dbusuarios.sql
Ver archivo creado.
[root@centos ~]# cat dump_dbusuarios.sql
-- MySQL dump 10.13 Distrib 5.1.73, for redhat-linux-gnu (x86_64)
--
Instalar MySQL CentOS | Moisés Araya
[8]
-- Host: localhost Database: usuarios
-- ------------------------------------------------------
-- Server version 5.1.73
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `administracion`
--
DROP TABLE IF EXISTS `administracion`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `administracion` (
`nombre` varchar(20) DEFAULT NULL,
`apellido` varchar(20) DEFAULT NULL,
`cargo` varchar(20) DEFAULT NULL,
`ingreso` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `administracion`
--
LOCK TABLES `administracion` WRITE;
/*!40000 ALTER TABLE `administracion` DISABLE KEYS */;
INSERT INTO `administracion` VALUES ('David','Errazuriz','Ingeniero','2014-01-
01'),('Arturo','Gonzalez','Gerente','2014-03-09'),('Gonzalo','Perez','Soporte','2013-03-
09');
/*!40000 ALTER TABLE `administracion` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2014-12-10 8:56:03
Restaurar BD
Instalar MySQL CentOS | Moisés Araya
[9]
Eliminar, crear y luego restaurar.
mysql> drop database usuarios;
Query OK, 1 row affected (0.08 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
mysql> create database usuarios;
Query OK, 1 row affected (0.02 sec)
[root@centos ~]# mysql -u root -proot usuarios < dump_dbusuarios.sql
mysql> select * from administracion;
+---------+-----------+-----------+------------+
| nombre | apellido | cargo | ingreso |
+---------+-----------+-----------+------------+
| David | Errazuriz | Ingeniero | 2014-01-01 |
| Arturo | Gonzalez | Gerente | 2014-03-09 |
| Gonzalo | Perez | Soporte | 2013-03-09 |
+---------+-----------+-----------+------------+
3 rows in set (0.00 sec)

Más contenido relacionado

La actualidad más candente

HA, SRX Cluster & Redundancy Groups
HA, SRX Cluster & Redundancy GroupsHA, SRX Cluster & Redundancy Groups
HA, SRX Cluster & Redundancy Groups
Kashif Latif
 
Capitulo 11 ospf
Capitulo 11 ospfCapitulo 11 ospf
Capitulo 11 ospf
malienlaf
 
Reporte de la instalacion y uso de una red en el sector productivo
Reporte de la instalacion  y uso de una red en el sector productivoReporte de la instalacion  y uso de una red en el sector productivo
Reporte de la instalacion y uso de una red en el sector productivo
ALOMACRAL
 
CCNA Network Services
CCNA Network ServicesCCNA Network Services
CCNA Network Services
Dsunte Wilson
 
Topologia celular
Topologia celularTopologia celular
Topologia celular
lupeziitha
 

La actualidad más candente (20)

DMVPN
DMVPNDMVPN
DMVPN
 
Protocolo tftp trabajo
Protocolo tftp trabajoProtocolo tftp trabajo
Protocolo tftp trabajo
 
MPLS VPN
MPLS VPNMPLS VPN
MPLS VPN
 
HA, SRX Cluster & Redundancy Groups
HA, SRX Cluster & Redundancy GroupsHA, SRX Cluster & Redundancy Groups
HA, SRX Cluster & Redundancy Groups
 
Capitulo 11 ospf
Capitulo 11 ospfCapitulo 11 ospf
Capitulo 11 ospf
 
Segment Routing: A Tutorial
Segment Routing: A TutorialSegment Routing: A Tutorial
Segment Routing: A Tutorial
 
NTP Server - How it works?
NTP Server - How it works?NTP Server - How it works?
NTP Server - How it works?
 
DMVPN Lab WorkBook
DMVPN Lab WorkBookDMVPN Lab WorkBook
DMVPN Lab WorkBook
 
144321080 e2-pt act-9-7-1-directions
144321080 e2-pt act-9-7-1-directions144321080 e2-pt act-9-7-1-directions
144321080 e2-pt act-9-7-1-directions
 
Reporte de la instalacion y uso de una red en el sector productivo
Reporte de la instalacion  y uso de una red en el sector productivoReporte de la instalacion  y uso de una red en el sector productivo
Reporte de la instalacion y uso de una red en el sector productivo
 
MPLS L3 VPN Deployment
MPLS L3 VPN DeploymentMPLS L3 VPN Deployment
MPLS L3 VPN Deployment
 
Transport layer services
Transport layer servicesTransport layer services
Transport layer services
 
Vlans and inter vlan routing
Vlans and inter vlan routingVlans and inter vlan routing
Vlans and inter vlan routing
 
CCNA Network Services
CCNA Network ServicesCCNA Network Services
CCNA Network Services
 
Topologia celular
Topologia celularTopologia celular
Topologia celular
 
Router configuration in packet tracer
Router configuration in packet  tracerRouter configuration in packet  tracer
Router configuration in packet tracer
 
MPLS: Multiprotocol Label Switching
MPLS: Multiprotocol Label SwitchingMPLS: Multiprotocol Label Switching
MPLS: Multiprotocol Label Switching
 
VLAN ON PACKET TRACER
VLAN ON PACKET TRACERVLAN ON PACKET TRACER
VLAN ON PACKET TRACER
 
BGP Weight Manipulation with Route Map
BGP Weight Manipulation with Route MapBGP Weight Manipulation with Route Map
BGP Weight Manipulation with Route Map
 
VLAN vs VXLAN
VLAN vs VXLANVLAN vs VXLAN
VLAN vs VXLAN
 

Destacado

Location Shots A2 Production
Location Shots A2 ProductionLocation Shots A2 Production
Location Shots A2 Production
kay91
 
Succession Planning By Vivek
Succession Planning By VivekSuccession Planning By Vivek
Succession Planning By Vivek
anshuvivek
 
Compulink Core Presentation
Compulink Core PresentationCompulink Core Presentation
Compulink Core Presentation
Compulink
 
Elförbrukning
ElförbrukningElförbrukning
Elförbrukning
swimp
 
Texas S Ta R Chart
Texas S Ta R ChartTexas S Ta R Chart
Texas S Ta R Chart
jkearley
 
Texas S Ta R Chart Presentation
Texas S Ta R Chart PresentationTexas S Ta R Chart Presentation
Texas S Ta R Chart Presentation
dbalder1
 
Ingilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
Ingilizce SarıBelen Anket Grafik 10 14 Yaş GrubuIngilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
Ingilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
Petros Michailidis
 
Profile
ProfileProfile
Profile
ewen27
 
Illustration Portfolio
Illustration PortfolioIllustration Portfolio
Illustration Portfolio
grantcodak.com
 
Activity3- Tomás Mingot High School. Pictorial Alphabet for Simplicity
Activity3-  Tomás Mingot High School. Pictorial Alphabet  for SimplicityActivity3-  Tomás Mingot High School. Pictorial Alphabet  for Simplicity
Activity3- Tomás Mingot High School. Pictorial Alphabet for Simplicity
Carlos Ajamil Royo
 
Prezentacja EnterMedia DST Warszawa 2010 Small Size
Prezentacja EnterMedia DST Warszawa 2010 Small SizePrezentacja EnterMedia DST Warszawa 2010 Small Size
Prezentacja EnterMedia DST Warszawa 2010 Small Size
EnterMedia
 

Destacado (20)

Gvl Berkeley Bristol University Canagarajah
Gvl Berkeley Bristol University CanagarajahGvl Berkeley Bristol University Canagarajah
Gvl Berkeley Bristol University Canagarajah
 
Location Shots A2 Production
Location Shots A2 ProductionLocation Shots A2 Production
Location Shots A2 Production
 
Succession Planning By Vivek
Succession Planning By VivekSuccession Planning By Vivek
Succession Planning By Vivek
 
Pictures
PicturesPictures
Pictures
 
Left Behind evaluation
Left Behind evaluationLeft Behind evaluation
Left Behind evaluation
 
Compulink Core Presentation
Compulink Core PresentationCompulink Core Presentation
Compulink Core Presentation
 
Bleach 386
Bleach 386Bleach 386
Bleach 386
 
Introductie GwwBesteksAdministratie - Online
Introductie GwwBesteksAdministratie - OnlineIntroductie GwwBesteksAdministratie - Online
Introductie GwwBesteksAdministratie - Online
 
Trinity Ndt Training Brochure
Trinity Ndt Training BrochureTrinity Ndt Training Brochure
Trinity Ndt Training Brochure
 
hawkeye Webinar: Increase Sales with Personalized URLs
hawkeye Webinar: Increase Sales with Personalized URLshawkeye Webinar: Increase Sales with Personalized URLs
hawkeye Webinar: Increase Sales with Personalized URLs
 
Michael & Sylvia - 50 years in pictures
Michael & Sylvia - 50 years in picturesMichael & Sylvia - 50 years in pictures
Michael & Sylvia - 50 years in pictures
 
Elförbrukning
ElförbrukningElförbrukning
Elförbrukning
 
Urban area detection and segmentation using OTB
Urban area detection and segmentation using OTBUrban area detection and segmentation using OTB
Urban area detection and segmentation using OTB
 
Texas S Ta R Chart
Texas S Ta R ChartTexas S Ta R Chart
Texas S Ta R Chart
 
Texas S Ta R Chart Presentation
Texas S Ta R Chart PresentationTexas S Ta R Chart Presentation
Texas S Ta R Chart Presentation
 
Ingilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
Ingilizce SarıBelen Anket Grafik 10 14 Yaş GrubuIngilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
Ingilizce SarıBelen Anket Grafik 10 14 Yaş Grubu
 
Profile
ProfileProfile
Profile
 
Illustration Portfolio
Illustration PortfolioIllustration Portfolio
Illustration Portfolio
 
Activity3- Tomás Mingot High School. Pictorial Alphabet for Simplicity
Activity3-  Tomás Mingot High School. Pictorial Alphabet  for SimplicityActivity3-  Tomás Mingot High School. Pictorial Alphabet  for Simplicity
Activity3- Tomás Mingot High School. Pictorial Alphabet for Simplicity
 
Prezentacja EnterMedia DST Warszawa 2010 Small Size
Prezentacja EnterMedia DST Warszawa 2010 Small SizePrezentacja EnterMedia DST Warszawa 2010 Small Size
Prezentacja EnterMedia DST Warszawa 2010 Small Size
 

Similar a Instalar MySQL CentOS

Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on Linux
Roger Eisentrager
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
Morgan Tocker
 

Similar a Instalar MySQL CentOS (20)

Curso de MySQL 5.7
Curso de MySQL 5.7Curso de MySQL 5.7
Curso de MySQL 5.7
 
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert VanderkelenOSMC 2008 | Monitoring MySQL by Geert Vanderkelen
OSMC 2008 | Monitoring MySQL by Geert Vanderkelen
 
Centosta mysql enterprise kurulumu
Centosta mysql enterprise kurulumuCentosta mysql enterprise kurulumu
Centosta mysql enterprise kurulumu
 
Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6Instalar PENTAHO 5 en CentOS 6
Instalar PENTAHO 5 en CentOS 6
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
Percona Live 2019 - MySQL Security
Percona Live 2019 - MySQL SecurityPercona Live 2019 - MySQL Security
Percona Live 2019 - MySQL Security
 
Whitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on LinuxWhitepaper MS SQL Server on Linux
Whitepaper MS SQL Server on Linux
 
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
Percona Live 4/15/15: Transparent sharding database virtualization engine (DVE)
 
TrinityCore server install guide
TrinityCore server install guideTrinityCore server install guide
TrinityCore server install guide
 
Introduction databases and MYSQL
Introduction databases and MYSQLIntroduction databases and MYSQL
Introduction databases and MYSQL
 
PHP mysql Introduction database
 PHP mysql  Introduction database PHP mysql  Introduction database
PHP mysql Introduction database
 
ProxySQL para mysql
ProxySQL para mysqlProxySQL para mysql
ProxySQL para mysql
 
DB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQLDB Floripa - ProxySQL para MySQL
DB Floripa - ProxySQL para MySQL
 
MySQLinsanity
MySQLinsanityMySQLinsanity
MySQLinsanity
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527
 
Lab 1 my sql tutorial
Lab 1 my sql tutorial Lab 1 my sql tutorial
Lab 1 my sql tutorial
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features Summary
 
Mysql basics1
Mysql basics1Mysql basics1
Mysql basics1
 
My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2My sql 5.7-upcoming-changes-v2
My sql 5.7-upcoming-changes-v2
 

Más de Moisés Elías Araya

Más de Moisés Elías Araya (20)

Instalar Docker Desktop y Kubernetes en Windows 10
Instalar Docker Desktop y Kubernetes en Windows 10Instalar Docker Desktop y Kubernetes en Windows 10
Instalar Docker Desktop y Kubernetes en Windows 10
 
Instalacion Vz Linux
Instalacion Vz LinuxInstalacion Vz Linux
Instalacion Vz Linux
 
Conectar instancia gcp con putty
Conectar instancia gcp con puttyConectar instancia gcp con putty
Conectar instancia gcp con putty
 
Instalar SDK Google Cloud
Instalar SDK Google CloudInstalar SDK Google Cloud
Instalar SDK Google Cloud
 
Instalacion y uso basico de Kubernetes.
Instalacion y uso basico de Kubernetes.Instalacion y uso basico de Kubernetes.
Instalacion y uso basico de Kubernetes.
 
Instalacion y uso basico de Docker.
Instalacion y uso basico de Docker.Instalacion y uso basico de Docker.
Instalacion y uso basico de Docker.
 
Terraform Cosmos DB
Terraform Cosmos DBTerraform Cosmos DB
Terraform Cosmos DB
 
Conceptos BPM
Conceptos BPMConceptos BPM
Conceptos BPM
 
Instalacion basica ELK (elasticsearch) Windows
Instalacion basica ELK (elasticsearch) WindowsInstalacion basica ELK (elasticsearch) Windows
Instalacion basica ELK (elasticsearch) Windows
 
Cuadro mando Excel
Cuadro mando ExcelCuadro mando Excel
Cuadro mando Excel
 
Graficar SAR Linux (System Activity Report)
Graficar SAR Linux (System Activity Report)Graficar SAR Linux (System Activity Report)
Graficar SAR Linux (System Activity Report)
 
Instalacion Weblogic Server 12c Windows 10.
Instalacion Weblogic Server 12c Windows 10.Instalacion Weblogic Server 12c Windows 10.
Instalacion Weblogic Server 12c Windows 10.
 
Ver uptime Windows
Ver uptime WindowsVer uptime Windows
Ver uptime Windows
 
Modificar aspecto consola Windows
Modificar aspecto consola WindowsModificar aspecto consola Windows
Modificar aspecto consola Windows
 
Resaltar celdas en Microsoft Excel.
Resaltar celdas en Microsoft Excel.Resaltar celdas en Microsoft Excel.
Resaltar celdas en Microsoft Excel.
 
Instalar y Configurar Python para Windows
Instalar y Configurar Python para WindowsInstalar y Configurar Python para Windows
Instalar y Configurar Python para Windows
 
Instalacion y uso basico de Jenkins
Instalacion y uso basico de JenkinsInstalacion y uso basico de Jenkins
Instalacion y uso basico de Jenkins
 
Instalacion de Docker CE en Windows 10
Instalacion de Docker CE en Windows 10Instalacion de Docker CE en Windows 10
Instalacion de Docker CE en Windows 10
 
Instalacion Weblogic Server 11g Linux
Instalacion Weblogic Server 11g LinuxInstalacion Weblogic Server 11g Linux
Instalacion Weblogic Server 11g Linux
 
Instalacion y Uso de JMeter
Instalacion y Uso de JMeterInstalacion y Uso de JMeter
Instalacion y Uso de JMeter
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Instalar MySQL CentOS

  • 1. Instalar MySQL CentOS | Moisés Araya [1] Instalar MySQL 5.1 en CentOS 6.4x64 A continuación se presenta una guía básica donde se muestra la instalación, configuración y algunas tareas básicas de uso de MySQL en un servidor Linux. Procedimiento. Instalar librerías. [root@centos ~]# yum -y install mysql-server Installed: mysql-server.x86_64 0:5.1.73-3.el6_5 Dependency Installed: make.x86_64 1:3.81-20.el6 mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6 Dependency Updated: mysql-libs.x86_64 0:5.1.73-3.el6_5 openssl.x86_64 0:1.0.1e-30.el6_6.4 Complete! [root@centos ~]# Editar archivo de configuración y agregar set de caracteres utf8 (útil para caracteres acentuados). [root@centos ~]# vi /etc/my.cnf [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 character-set-server=utf8 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid Iniciar MySQL. [root@centos ~]# /etc/rc.d/init.d/mysqld start Iniciando base de datos MySQL: WARNING: The host 'centos.lab' could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Installing MySQL system tables... OK
  • 2. Instalar MySQL CentOS | Moisés Araya [2] Filling help tables... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h centos.lab password 'new-password' Alternatively you can run: /usr/bin/mysql_secure_installation which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with: cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems with the /usr/bin/mysqlbug script! [ OK ] Iniciando mysqld: [ OK ] Configurar inicio de servicio. [root@centos ~]# chkconfig mysqld on Configuración segura de MySQL.  Seteo de contraseña de usuario root.  Eliminar usuarios anónimos.  Deshabilitar el acceso remoto de root  Eliminar las bases de datos de test
  • 3. Instalar MySQL CentOS | Moisés Araya [3] [root@centos ~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] Y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure. Thanks for using MySQL!
  • 4. Instalar MySQL CentOS | Moisés Araya [4] Conectarse a MySQL. [root@centos ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 10 Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement. mysql> Mostrar usuarios/DB y salir. mysql> select user,host,password from mysql.user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | | root | 127.0.0.1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B | +------+-----------+-------------------------------------------+ 2 rows in set (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec) mysql> exit Bye [root@centos ~]# Revisar version mysql> select version(), current_date; +-----------+--------------+ | version() | current_date | +-----------+--------------+ | 5.1.73 | 2014-11-24 | +-----------+--------------+ 1 row in set (0.03 sec)
  • 5. Instalar MySQL CentOS | Moisés Araya [5] Crear DB y mostrar DB existentes. mysql> create database usuarios; Query OK, 1 row affected (0.00 sec) mysql> use usuarios Database changed mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | usuarios | +--------------------+ 3 rows in set (0.00 sec) Seleccionar Base de datos. mysql> use mysql; Database changed Crear tablas/Mostrar tablas. mysql> show tables; Empty set (0.00 sec) mysql> CREATE TABLE administracion (nombre VARCHAR(20), apellido VARCHAR(20), cargo VARCHAR(20), ingreso DATE); Query OK, 0 rows affected (0.08 sec) mysql> show tables; +--------------------+ | Tables_in_usuarios | +--------------------+ | administracion | +--------------------+ 1 row in set (0.00 sec) Mostrar la estructura de la tabla creada, mysql> describe administracion; +----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+-------------+------+-----+---------+-------+ | nombre | varchar(20) | YES | | NULL | | | apellido | varchar(20) | YES | | NULL | | | cargo | varchar(20) | YES | | NULL | | | ingreso | date | YES | | NULL | | +----------+-------------+------+-----+---------+-------+
  • 6. Instalar MySQL CentOS | Moisés Araya [6] Cargar datos en la DB. mysql> INSERT INTO administracion VALUES ('David','Errazuriz','Ingeniero','2014-01-01'); Query OK, 1 row affected (0.00 sec) Obtener información de la tabla modificada. mysql> SELECT * FROM administracion; +--------+-----------+-----------+------------+ | nombre | apellido | cargo | ingreso | +--------+-----------+-----------+------------+ | David | Errazuriz | Ingeniero | 2014-01-01 | +--------+-----------+-----------+------------+ 1 row in set (0.00 sec) Borrar datos de la tabla. mysql> DELETE FROM administracion; Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM administracion; Empty set (0.00 sec) Actualizar algún registro. mysql> UPDATE administracion SET cargo="gerente" -> WHERE nombre="David"; Query OK, 1 row affected (0.04 sec) Rows matched: 1 Changed: 1 Warnings: 0 mysql> SELECT * FROM administracion; +--------+-----------+---------+------------+ | nombre | apellido | cargo | ingreso | +--------+-----------+---------+------------+ | David | Errazuriz | gerente | 2014-01-01 | +--------+-----------+---------+------------+ 1 row in set (0.00 sec) Buscar información en una tabla. Para esto se han añadido tres registros a la tabla. mysql> SELECT * FROM administracion; +---------+-----------+-----------+------------+ | nombre | apellido | cargo | ingreso | +---------+-----------+-----------+------------+ | David | Errazuriz | Ingeniero | 2014-01-01 | | Arturo | Gonzalez | Gerente | 2014-03-09 | | Gonzalo | Perez | Soporte | 2013-03-09 | +---------+-----------+-----------+------------+
  • 7. Instalar MySQL CentOS | Moisés Araya [7] mysql> SELECT * FROM administracion WHERE nombre='Arturo'; +--------+----------+---------+------------+ | nombre | apellido | cargo | ingreso | +--------+----------+---------+------------+ | Arturo | Gonzalez | Gerente | 2014-03-09 | +--------+----------+---------+------------+ 1 row in set (0.00 sec) Búsqueda compuesta mysql> SELECT * FROM administracion WHERE cargo='Ingeniero' AND nombre='David'; +--------+-----------+-----------+------------+ | nombre | apellido | cargo | ingreso | +--------+-----------+-----------+------------+ | David | Errazuriz | Ingeniero | 2014-01-01 | +--------+-----------+-----------+------------+ 1 row in set (0.00 sec) Seleccionar solo algunos campos mysql> SELECT nombre, cargo FROM administracion; +---------+-----------+ | nombre | cargo | +---------+-----------+ | David | Ingeniero | | Arturo | Gerente | | Gonzalo | Soporte | +---------+-----------+ 3 rows in set (0.00 sec) Ordenar resultados mysql> SELECT nombre FROM administracion ORDER BY ingreso; +---------+ | nombre | +---------+ | Gonzalo | | David | | Arturo | +---------+ Respaldar y restaurar Respaldar. [root@centos ~]# mysqldump -u root -proot usuarios > dump_dbusuarios.sql Ver archivo creado. [root@centos ~]# cat dump_dbusuarios.sql -- MySQL dump 10.13 Distrib 5.1.73, for redhat-linux-gnu (x86_64) --
  • 8. Instalar MySQL CentOS | Moisés Araya [8] -- Host: localhost Database: usuarios -- ------------------------------------------------------ -- Server version 5.1.73 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; -- -- Table structure for table `administracion` -- DROP TABLE IF EXISTS `administracion`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `administracion` ( `nombre` varchar(20) DEFAULT NULL, `apellido` varchar(20) DEFAULT NULL, `cargo` varchar(20) DEFAULT NULL, `ingreso` date DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `administracion` -- LOCK TABLES `administracion` WRITE; /*!40000 ALTER TABLE `administracion` DISABLE KEYS */; INSERT INTO `administracion` VALUES ('David','Errazuriz','Ingeniero','2014-01- 01'),('Arturo','Gonzalez','Gerente','2014-03-09'),('Gonzalo','Perez','Soporte','2013-03- 09'); /*!40000 ALTER TABLE `administracion` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2014-12-10 8:56:03 Restaurar BD
  • 9. Instalar MySQL CentOS | Moisés Araya [9] Eliminar, crear y luego restaurar. mysql> drop database usuarios; Query OK, 1 row affected (0.08 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec) mysql> create database usuarios; Query OK, 1 row affected (0.02 sec) [root@centos ~]# mysql -u root -proot usuarios < dump_dbusuarios.sql mysql> select * from administracion; +---------+-----------+-----------+------------+ | nombre | apellido | cargo | ingreso | +---------+-----------+-----------+------------+ | David | Errazuriz | Ingeniero | 2014-01-01 | | Arturo | Gonzalez | Gerente | 2014-03-09 | | Gonzalo | Perez | Soporte | 2013-03-09 | +---------+-----------+-----------+------------+ 3 rows in set (0.00 sec)