Вы находитесь на странице: 1из 2

Microsoft Windows [Versi�n 10.0.17134.

407]
(c) 2018 Microsoft Corporation. Todos los derechos reservados.

C:\Users\salom>CD C:/xampp/mysql/bin

C:\xampp\mysql\bin>mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 50
Server version: 10.1.37-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> SHOW DATABASES;


+--------------------+
| Database |
+--------------------+
| information_schema |
| microprocesadores |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
+--------------------+
6 rows in set (0.00 sec)

MariaDB [(none)]> CREATE DATABASE userscal;


Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> SHOW DATABASES;


+--------------------+
| Database |
+--------------------+
| information_schema |
| microprocesadores |
| mysql |
| performance_schema |
| phpmyadmin |
| test |
| userscal |
+--------------------+
7 rows in set (0.00 sec)

MariaDB [(none)]> USE userscal;


Database changed
MariaDB [userscal]> SHOW TABLES;
Empty set (0.00 sec)

MariaDB [userscal]> CREATE TABLE users(


-> id int(2),
-> tipcuen varchar(15),
-> nombre varchar(15),
-> contra varchar(15)
-> );
Query OK, 0 rows affected (0.35 sec)

MariaDB [userscal]> DESCRIBE users;


+---------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+-------------+------+-----+---------+-------+
| id | int(2) | YES | | NULL | |
| tipcuen | varchar(15) | YES | | NULL | |
| nombre | varchar(15) | YES | | NULL | |
| contra | varchar(15) | YES | | NULL | |
+---------+-------------+------+-----+---------+-------+
4 rows in set (0.03 sec)

MariaDB [userscal]> ALTER TABLE users ADD PRIMARY KEY(id);


Query OK, 0 rows affected (0.73 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [userscal]> ALTER TABLE users CHANGE id id int(2) AUTO_INCREMENT;


Query OK, 0 rows affected (0.91 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [userscal]> INSERT INTO users(tipcuen, nombre, contra)


VALUES('admin','admin','admin');
Query OK, 1 row affected (0.09 sec)

MariaDB [userscal]> SELECT *FROM users;


+----+---------+--------+--------+
| id | tipcuen | nombre | contra |
+----+---------+--------+--------+
| 1 | admin | admin | admin |
+----+---------+--------+--------+
1 row in set (0.00 sec)