Servidores VPS rápidos, escalables y muy económicos:

Servidor VPS SSD Optimizados

Este post con código 1369, con la dirección web https://www.exabyteinformatica.com/tienda/foro/an-introduction-to-mysql-t1369.html y con una longitud de 82 caracteres, se ha cargado correctamente. Para poder acceder a los sub-foros o temas, pulsa en el título de cada enlace de la lista de esta página (el título que aparece junto al mushroom). Recuerda que en algunas páginas hay un selector de registros situado en la parte inferior que te permitirá saltar a más páginas.Si quieres decir la tuya al respecto de este tema o de cualquier otro, primero es necesario registrarte en exaforo.com, no cuesta dinero: es GRATIS.

Deberás haber leído y aceptado eso sí, las Normas generales del foro. Sólo te pedimos un valor: el respeto por los demás miembros de la comunidad. Si detectamos cualquier actitud poco respetuosa hacia a algún miembro, tu cuenta será cancelada. Así mismo, si algún miembro tiene una actitud irrespetuosa hacia ti, su cuenta será igualmente cancelada.

Cuando decidas escribir para nosotr@s, por favor, no copies y pegues contenido que ya exista en otra página web o que ya sea de otro usuario. Ten en cuenta que si detectamos contenido duplicado, el sistema anti-spam procederá a borrarlo sin prévio aviso.

A modo de conclusión, el equipo humano de Exaforo te desea una provechosa estancia con nosotros y te animamos a que revises los temas que más te interesan del foro para extraer y aportar el máximo de información posible.

¡Muchas gracias por dedicarnos unos minutos y disfruta mucho con nuestra comunidad!

Datos internos informativos (No hagas caso de estos datos, son para los administradores de Exaforo)

Fecha y hora de carga de esta página: 23/092018 a las 17:19:00
Memória total usada: 7514544

¿Y el logo de Paypal? ¿Exaforo no era sin ánimo de lucro? Y así es, para poder usar Exaforo nadie cobra nada, fíjate bien que el botón de Paypal es el de donaciones. Mantener la web en un servidor encendido 24 horas, contratar la conexión a internet de alta velocidad para que goces de peticiones rápidas, pagar los certificados SSL,…es decir, los costes de mantenimiento.

Nuestros pocos fondos van destinados a mantener siempre en marcha los sistemas y cuando adquirimos equipos nuevos, los viejos solemos donarlos a escuelas y centros educativos que tienen pocos recursos para adquirir equipos informáticos. Por eso tus donaciones son muy importantes ya que no solo nos ayudan a nosotros sino también a niños en edad escolar, al profesorado y a los centros educativos en general. En exaforo creemos en la formación libre y que sea accesible a todo el mundo. Si crees poder ayudarnos haciendo una donación para que sigamos creciendo como hemos ido haciendo desde 2003, te estaremos muy agradecidos, el importe de la donación lo pones tú, nosotros no pedimos una cantidad fija, piensa que puedes donar hasta mínimo 1 céntimo. Dones o no dones, muchas gracias por habernos leído hasta el final. Más abajo tienes el botón de “Donar con Paypal” (no hace falta que des tu número de la tarjeta, el botón te dirige a la página oficial de Paypal y desde su formulario puedes hacer la donación desde tu cuenta Paypal).

An introduction to MySQL  An introduction to MySQL

Valoración de éste post
4.72 / 5 de 548 votos



Mensajes: 956


Puntos totales:

Enhorabuena!

32




El contenido de este artículo o información está sujeto a una licencia Creative Commons BY (CC-BY), puedes divulgar públicamente este contenido pero deberás hacer mención del autor: Kernel e indicar la dirección web de esta página: https://www.exabyteinformatica.com/tienda/foro/an-introduction-to-mysql-t1369.html

The content of this article or any related information is under the Creative Commons license BY, you can republish this content freely but you must mention the author of this article: Kernel and indicate the URL of this page: https://www.exabyteinformatica.com/tienda/foro/an-introduction-to-mysql-t1369.html

Bajo licencia de Creative Commons


At some point to your existence as a Linux administrator, you’re going to need to work with a database. And because you’re working with the Linux platform, likelihood is high that database could be MySQL. In some cases, you’ll most effective deserve to engage with MySQL long satisfactory to create an empty database to be used for a web-based tool, akin to OrangeHRM, Wordpress, Drupal, or Nextcloud. You may also be heading in the right direction to gain knowledge of the open supply database tool, in hopes of one day serving as a database administrator for a company.

Inspired of why, you need to stand up to speed with MySQL...and that very smartly may imply starting from the very beginning. That’s precisely what we’re here for: to deploy MySQL and learn the way to make use of it, while not having to depend upon a GUI device for the entire heavy lifting.

I’ll be demonstrating on a fresh installation of Ubuntu 16.10. Let’s kick this off through installation MySQL.
Installation

There are a number of easy methods to install MySQL. You can install it as a standalone server from the command line, which you could installation it from the GUI package manager (as in Ubuntu software), or you can install it alongside a full-blown LAMP (Linux Apache MySQL personal home page) server. Because, greater often than now not, you’ll be using MySQL on a LAMP server, let’s go that route. Why? Because it tends to be the most fulfilling formulation of installation MySQL on a Debian-based mostly distribution.

The installing of a LAMP server will vary from distribution to distribution. For Ubuntu, that intention will also be accomplished with a single command:

sudo apt-get deploy lamp-server^


The above command will installation all the essential dependencies on your LAMP server.

All the way through the installing, you’ll be triggered to enter (and verify) a password for the MySQL “root” consumer (determine 1).

Don't go away this blank. Enter a robust password for the MySQL root person and tab all the way down to adequate, hit Enter in your keyboard, after which retype the new password. The setting up will proceed to completion. You at the moment are ready to start working with MySQL.

Logging into MySQL

To work with MySQL, you have to log into what's referred to as the MySQL Shell. this is fairly different out of your normal bash shell, and you are restricted to MySQL-most effective commands. Should you log into MySQL use the foundation user and the password you simply created (during installing).

When logging in, that you would be able to specify not handiest which person to work with but additionally which database to use. We haven’t created a database yet, so we will only be specifying a consumer. To log in, open up a terminal window, and situation the command:

mysql -u root -p


The -u choice shows what consumer you will log in with and the -p option tells MySQL to require a password. When precipitated, enter the password you created throughout setting up and you will be greeted with the MySQL Shell (determine 2).

Developing a new database

The first element to do is create a new database. Let’s say we need to create a new database known as purchasers. To do that, you’d challenge the command:

CREATE DATABASE valued clientele;


Be aware the ending “;” character. This is essential, because it instructs MySQL of the command conclusion. You may situation that command as:

CREATE DATABASE consumers


And MySQL would return a > immediate. If there were extra to that command, you may enter it there. When you’d completed the command, class; and hit the Enter key to your keyboard. I prefer to enter my commands unexpectedly (to evade confusion).

If you challenge the comprehensive command, MySQL will return:

1 row affected (0.00 sec)

Your database has been created. as it stands, you can't work with that database, because you’re no longer the use of it. to use the newly created shoppers database, you need to difficulty the command:

USE customers;


MySQL will return:
Database modified mysql>

That you could now work with the newly created database.

Creating a desk

Unless you are with ease growing the database to be used by means of a 3rd-birthday party software (and the installation of noted third-birthday celebration application will populate the database with the necessary tips), your database needs records. For a database, information starts with tables. Let’s say we are looking to create a table for our new client database a good way to include right here assistance:

To try this, you first need to know what type of characters may be essential for every entry. The three basic kinds obtainable are:

All three features of suggestions for our desk (identify, e mail, cell phone) might be VARCHAR. Why?

• no longer all names and emails could be the identical size
• For clarity, phone numbers are damaged into 123-456-7890 and the “-” character is not an integer.
Let’s create a table for the purchaser’s database, called hardware. To accomplish that, enter the command (from the MySQL Shell):

CREATE desk hardware (identify VARCHAR(20), e mail VARCHAR(20), phone VARCHAR(20));


The table can be created (figure 3), and you will be again to the MySQL instant.

Now that you've a database and a table, all that is still is to add statistics to the newly created desk.

Adding records to tables

We’re going to add our first entry to the hardware table (which may well be a listing of purchasers that sell or purchase hardware). The entry should be:

Identify: Bethany Nitshimi electronic mail: bethany@business.com phone: 555-123-4567

Here’s what the MySQL command will seem like:

INSERT INTO hardware (identify,email,mobile) VALUES ("Bethany Nitshimi","bethany@company.com",”555-123-4567”);


The records can be brought to the desk and MySQL will return you again to the immediate.

if you don’t wish to manually enter the information one row at a time, which you could all the time import it from a text file. The textual content file in question would need to be formatted in a similar fashion as was in the above command. So, to import records into the hardware table, each and every entry of the textual content file would need to be (one per line):

Identify e mail mobile

As in:

Bronson Coulter bronson@enterprise.com 555-987-6543
Be aware: The statistics need to be delineated by using a tab.
After getting that file created (we’ll call it facts), go back to the MySQL Shell (make certain to use the consumer’s database), and concern the command:

LOAD records native INFILE '/course/statistics' INTO table hardware;


The place path is the exact course to the records file.

Which you can view the contents of the hardware table with the command:

opt for * FROM hardware;


MySQL will issue a document on the entire statistics contained with that desk (determine 5).

Your database is in a position

When you’ve added all of the tables and statistics to your database, which you can difficulty the command exit to depart the MySQL Shell. Your database is ready to be used. Youngsters this can best function an introduction to MySQL, make sure you now have a high-quality understanding of a way to deploy MySQL, log in, create a database, create a table, and fill the table with records. If you happen to be able to circulation onto extra advanced subject matters that you could all the time try the reliable MySQL documentation.

Salta al siguiente tema: MySQL 8.0: Records dictionary architecture and design

Quizás también te interese:
Si has encontrado información útil en Exaforo, ayúdanos a seguir creciendo. Muchas gracias por confiar en nosotros!


Volver a MySQL