0% found this document useful (0 votes)
7 views

terminal_mysql

Uploaded by

03avfcs
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

terminal_mysql

Uploaded by

03avfcs
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

root@isa-virtual-machine:/home/isa# docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES


root@isa-virtual-machine:/home/isa# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
250b37077087 mysql "docker-entrypoint.s…" 13 minutes ago
Exited (0) 2 minutes ago musing_bartik
8100a1765337 mysql "docker-entrypoint.s…" 35 minutes ago
Exited (1) 35 minutes ago container_banco
bf9a72121161 mysql "docker-entrypoint.s…" About an hour ago
Exited (1) About an hour ago laughing_rosalind
9b848fa513a1 mysql/mysql-server "/entrypoint.sh mysq…" 3 hours ago
Exited (0) 58 minutes ago my_sql_container
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago
Exited (0) 17 hours ago fornos_termogravimetricos
7d39976d3fdc hello-world "/hello" 18 hours ago
Exited (0) 18 hours ago recursing_chandrasekhar
root@isa-virtual-machine:/home/isa# docker rm musing_bartik
musing_bartik
root@isa-virtual-machine:/home/isa# docker rm container_banco
container_banco
root@isa-virtual-machine:/home/isa# ls
Desktop Documents Downloads Music Pictures Public snap Templates Videos
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@isa-virtual-machine:/home/isa# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
bf9a72121161 mysql "docker-entrypoint.s…" About an hour ago
Exited (1) About an hour ago laughing_rosalind
9b848fa513a1 mysql/mysql-server "/entrypoint.sh mysq…" 3 hours ago
Exited (0) 59 minutes ago my_sql_container
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago
Exited (0) 17 hours ago fornos_termogravimetricos
7d39976d3fdc hello-world "/hello" 18 hours ago
Exited (0) 18 hours ago recursing_chandrasekhar
root@isa-virtual-machine:/home/isa# docker start fornos_termogravimentricos
Error response from daemon: No such container: fornos_termogravimentricos
Error: failed to start containers: fornos_termogravimentricos
root@isa-virtual-machine:/home/isa# docker start fornos_termogravimetricos
fornos_termogravimetricos
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago Up 3 seconds
3306/tcp, 33060/tcp fornos_termogravimetricos
root@isa-virtual-machine:/home/isa# docker exec -it fornos_termogravimetricos bash
bash-5.1# mysql -u isa
ERROR 1045 (28000): Access denied for user 'isa'@'localhost' (using password: NO)
bash-5.1# mysql -u isa -p
Enter password:
ERROR 1045 (28000): Access denied for user 'isa'@'localhost' (using password: YES)
bash-5.1# mysql -u isa -p
Enter password:
ERROR 1045 (28000): Access denied for user 'isa'@'localhost' (using password: YES)
bash-5.1# exit
exit
root@isa-virtual-machine:/home/isa# docker stop fornos_termogravimetricos
fornos_termogravimetricos
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@isa-virtual-machine:/home/isa# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
bf9a72121161 mysql "docker-entrypoint.s…" About an hour ago
Exited (1) About an hour ago laughing_rosalind
9b848fa513a1 mysql/mysql-server "/entrypoint.sh mysq…" 3 hours ago
Exited (0) About an hour ago my_sql_container
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago
Exited (0) 6 seconds ago fornos_termogravimetricos
7d39976d3fdc hello-world "/hello" 18 hours ago
Exited (0) 18 hours ago recursing_chandrasekhar
root@isa-virtual-machine:/home/isa# docker start -e MYSQL_ROOT_PASSWORD=Is@20052014
fornos_termogravimetros
unknown shorthand flag: 'e' in -e
See 'docker start --help'.
root@isa-virtual-machine:/home/isa# docker run --name fornos_termogravimetros -e
MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest
2e06418c6efbc97eeaf14bff8ce65eb5d7adf8747eb170522fd978f6639bf4de
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
2e06418c6efb mysql:latest "docker-entrypoint.s…" 29 seconds ago Up 28
seconds 3306/tcp, 33060/tcp fornos_termogravimetros
root@isa-virtual-machine:/home/isa# docker exec -it fornos_termogravimetricos bash
Error response from daemon: container
ba19f8d0ed4ea3c52a14f6129c8935610c6a269d564f6dc51f910348daa93769 is not running
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
2e06418c6efb mysql:latest "docker-entrypoint.s…" About a minute ago Up
About a minute 3306/tcp, 33060/tcp fornos_termogravimetros
root@isa-virtual-machine:/home/isa# docker stop fornos_termogravimetricos
fornos_termogravimetricos
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
2e06418c6efb mysql:latest "docker-entrypoint.s…" About a minute ago Up
About a minute 3306/tcp, 33060/tcp fornos_termogravimetros
root@isa-virtual-machine:/home/isa# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED
STATUS PORTS NAMES
2e06418c6efb mysql:latest "docker-entrypoint.s…" About a minute ago
Up About a minute 3306/tcp, 33060/tcp fornos_termogravimetros
bf9a72121161 mysql "docker-entrypoint.s…" 2 hours ago
Exited (1) 2 hours ago laughing_rosalind
9b848fa513a1 mysql/mysql-server "/entrypoint.sh mysq…" 3 hours ago
Exited (0) About an hour ago my_sql_container
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago
Exited (0) 5 minutes ago fornos_termogravimetricos
7d39976d3fdc hello-world "/hello" 18 hours ago
Exited (0) 18 hours ago recursing_chandrasekhar
root@isa-virtual-machine:/home/isa# docker rm fornos_termogravimetros
Error response from daemon: cannot remove container "/fornos_termogravimetros":
container is running: stop the container before removing or force remove
root@isa-virtual-machine:/home/isa# docker rm -f fornos_termogravimetros
fornos_termogravimetros
root@isa-virtual-machine:/home/isa# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
root@isa-virtual-machine:/home/isa# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS
PORTS NAMES
bf9a72121161 mysql "docker-entrypoint.s…" 2 hours ago Exited
(1) 2 hours ago laughing_rosalind
9b848fa513a1 mysql/mysql-server "/entrypoint.sh mysq…" 3 hours ago Exited
(0) About an hour ago my_sql_container
ba19f8d0ed4e mysql "docker-entrypoint.s…" 18 hours ago Exited
(0) 6 minutes ago fornos_termogravimetricos
7d39976d3fdc hello-world "/hello" 18 hours ago Exited
(0) 18 hours ago recursing_chandrasekhar
root@isa-virtual-machine:/home/isa# docker run --name fornos_termogravimetricos -e
MYSQL_ROOT_PASSWORD=Is@20052014 -d mysql
docker: Error response from daemon: Conflict. The container name
"/fornos_termogravimetricos" is already in use by container
"ba19f8d0ed4ea3c52a14f6129c8935610c6a269d564f6dc51f910348daa93769". You have to
remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
root@isa-virtual-machine:/home/isa# docker start fornos_termogravimetricos
fornos_termogravimetricos
root@isa-virtual-machine:/home/isa# docker exec -it fornos_termogravimetricos bash
bash-5.1# nano /etc/mysql/mt.cnf
bash: nano: command not found
bash-5.1# nano /etc/mysql/my.cnf
bash: nano: command not found
bash-5.1# vi /etc/mysql/my.cnf
bash: vi: command not found
bash-5.1# cd /etc/mysql
bash-5.1# ls
conf.d
bash-5.1# exit
exit
root@isa-virtual-machine:/home/isa# docker exec -it fornos_termogravimetricos mysql
-u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 9.1.0 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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> select * from users;


ERROR 1046 (3D000): No database selected
mysql> select * from user;
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from user;
+-----------+------------------+-------------+-------------+-------------
+-------------+-------------+-----------+-------------+---------------
+--------------+-----------+------------+-----------------+------------
+------------+--------------+------------+-----------------------
+------------------+--------------+-----------------+------------------
+------------------+----------------+---------------------+--------------------
+------------------+------------+--------------+------------------------+----------
+------------------------+--------------------------+----------------------------
+---------------+-------------+-----------------+----------------------
+-----------------------
+------------------------------------------------------------------------
+------------------+-----------------------+-------------------+----------------
+------------------+----------------+------------------------+---------------------
+--------------------------+-----------------+
| Host | User | Select_priv | Insert_priv | Update_priv |
Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv
| File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv
| Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv |
Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv |
Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv |
Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher |
x509_issuer | x509_subject | max_questions | max_updates
| max_connections | max_user_connections | plugin |
authentication_string |
password_expired | password_last_changed | password_lifetime | account_locked |
Create_role_priv | Drop_role_priv | Password_reuse_history | Password_reuse_time |
Password_require_current | User_attributes |
+-----------+------------------+-------------+-------------+-------------
+-------------+-------------+-----------+-------------+---------------
+--------------+-----------+------------+-----------------+------------
+------------+--------------+------------+-----------------------
+------------------+--------------+-----------------+------------------
+------------------+----------------+---------------------+--------------------
+------------------+------------+--------------+------------------------+----------
+------------------------+--------------------------+----------------------------
+---------------+-------------+-----------------+----------------------
+-----------------------
+------------------------------------------------------------------------
+------------------+-----------------------+-------------------+----------------
+------------------+----------------+------------------------+---------------------
+--------------------------+-----------------+
| % | isa | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password |
$A$005$#p8:uPh2BI@i}#e2bOJ/l46Qpy2qwuAsy5qf5cY4s02mJB8DwBGqSny.02 | N
| 2024-11-19 20:49:59 | NULL | N | Y | Y
| NULL | NULL | NULL | NULL
|
| % | root | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password |
$A$005$U*nQ#;2hH5J^%9k6MeS3a9fB8mCQd693CiRSjL.U2VO.rX3zOTFCT7lc6 | N
| 2024-11-19 20:31:44 | NULL | N | Y | Y
| NULL | NULL | NULL | NULL
|
| localhost | mysql.infoschema | Y | N | N | N
| N | N | N | N | N | N
| N | N | N | N | N | N
| N | N | N | N | N
| N | N | N | N | N
| N | N | N | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N
| 2024-11-19 20:31:38 | NULL | Y | N | N
| NULL | NULL | NULL | NULL
|
| localhost | mysql.session | N | N | N | N
| N | N | N | Y | N | N
| N | N | N | N | N | Y
| N | N | N | N | N
| N | N | N | N | N
| N | N | N | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N
| 2024-11-19 20:31:38 | NULL | Y | N | N
| NULL | NULL | NULL | NULL
|
| localhost | mysql.sys | N | N | N | N
| N | N | N | N | N | N
| N | N | N | N | N | N
| N | N | N | N | N
| N | N | N | N | N
| N | N | N | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password |
$A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | N
| 2024-11-19 20:31:38 | NULL | Y | N | N
| NULL | NULL | NULL | NULL
|
| localhost | root | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | Y | Y
| Y | Y | Y | | 0x
| 0x | 0x | 0 |
0 | 0 | 0 | caching_sha2_password | $A$005$R}`

8_])Zvq*iGqt60Eb/gKqSGYHI4x.ODfmD6QnkkQ4LScLWG25DvW95 | N | 2024-11-
19 20:31:44 | NULL | N | Y | Y
| NULL | NULL | NULL | NULL
|
+-----------+------------------+-------------+-------------+-------------
+-------------+-------------+-----------+-------------+---------------
+--------------+-----------+------------+-----------------+------------
+------------+--------------+------------+-----------------------
+------------------+--------------+-----------------+------------------
+------------------+----------------+---------------------+--------------------
+------------------+------------+--------------+------------------------+----------
+------------------------+--------------------------+----------------------------
+---------------+-------------+-----------------+----------------------
+-----------------------
+------------------------------------------------------------------------
+------------------+-----------------------+-------------------+----------------
+------------------+----------------+------------------------+---------------------
+--------------------------+-----------------+
6 rows in set (0.00 sec)

mysql> select user from user;


+------------------+
| user |
+------------------+
| isa |
| root |
| mysql.infoschema |
| mysql.session |
| mysql.sys |
| root |
+------------------+
6 rows in set (0.00 sec)

mysql> use fornos_termogravimetricos;


ERROR 1049 (42000): Unknown database 'fornos_termogravimetricos'
mysql> crate database fornos_termogravimetricos;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'crate
database fornos_termogravimetricos' at line 1
mysql> create database fornos_termogravimetricos;
Query OK, 1 row affected (0.00 sec)

mysql> use fornos_termogravimetricos


Database changed
mysql> create rable leitura()
-> Bye
root@isa-virtual-machine:/home/isa# docker exec -it fornos_termogravimetricos mysql
-u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 9.1.0 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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> use fornos_termogravimetricos


Database changed
mysql> create table leituras( id_leitura int not null auto_increment, data_criacao
datetime not null, data_fim datetime, PRIMARY KEY (id_leitura));
Query OK, 0 rows affected (0.04 sec)

mysql> show tables;


+-------------------------------------+
| Tables_in_fornos_termogravimetricos |
+-------------------------------------+
| leituras |
+-------------------------------------+
1 row in set (0.00 sec)

mysql> select * from leituras;


Empty set (0.04 sec)

mysql> create table registros( id_registro it not null auto_increment, data_criacao


datetime not null, forno int not null, temperatura1 float, temperatura2 float,
temperatura3 float, balanca float, setpoint float, id_leitura int, PRIMARY
KEY(id_registro), FOREIGN KEY(id_leitura) REFERENCES leituras(id_leitura));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'it not
null auto_increment, data_criacao datetime not null, forno int not null, ' at line
1
mysql> create table registros( id_registro int not null auto_increment,
data_criacao datetime not null, forno int not null, temperatura1 float,
temperatura2 float, temperatura3 float,
balanca float, setpoint float, id_leitura int, PRIMARY KEY(id_registro), FOREIGN
KEY(id_leitura) REFERENCES leituras(id_leitura));
Query OK, 0 rows affected (0.03 sec)

mysql> show tables


-> ;
+-------------------------------------+
| Tables_in_fornos_termogravimetricos |
+-------------------------------------+
| leituras |
| registros |
+-------------------------------------+
2 rows in set (0.01 sec)

mysql> show columns from registros;


+--------------+----------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------+----------+------+-----+---------+----------------+
| id_registro | int | NO | PRI | NULL | auto_increment |
| data_criacao | datetime | NO | | NULL | |
| forno | int | NO | | NULL | |
| temperatura1 | float | YES | | NULL | |
| temperatura2 | float | YES | | NULL | |
| temperatura3 | float | YES | | NULL | |
| balanca | float | YES | | NULL | |
| setpoint | float | YES | | NULL | |
| id_leitura | int | YES | MUL | NULL | |
+--------------+----------+------+-----+---------+----------------+
9 rows in set (0.02 sec)

mysql>

You might also like