Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- antoine@PC-Antoine:~$ mysql -u root -p Azerty67 -h local
- Enter password:
- ERROR 2005 (HY000): Unknown MySQL server host 'local' (0)
- antoine@PC-Antoine:~$ mysql -u root -p Azerty67 -h
- mysql: [ERROR] mysql: option '-h' requires an argument
- antoine@PC-Antoine:~$ mysql -u root -p Azerty67
- Enter password:
- ERROR 1049 (42000): Unknown database 'Azerty67'
- antoine@PC-Antoine:~$ mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 5
- Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
- Copyright (c) 2000, 2016, 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> CREATE DATABASE Eleves WCS;
- 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 'WCS' at line 1
- mysql> CREATE DATABASE Eleves_WCS;
- Query OK, 1 row affected (0.00 sec)
- mysql> CREATE TABLE lste_eleve (
- ->
- [1]+ Stopped mysql -u root -p
- antoine@PC-Antoine:~$ mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 6
- Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
- Copyright (c) 2000, 2016, 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> USE Eleves_WCS
- Database changed
- mysql> CREATE TABLE liste_eleves (
- -> Nom VARCHAR(100),
- -> Prénom VARCHAR(100),
- -> Age int,
- -> Lieu de résidence VARCHAR(100),
- -> );
- 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 'de résidence VARCHAR(100),
- )' at line 6
- mysql> CREATE TABLE liste_eleves ( Nom VARCHAR(100), Prénom VARCHAR(100), Age int, Lieu de résidence VARCHAR(100));
- 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 'de résidence VARCHAR(100))' at line 1
- mysql> CREATE TABLE liste_eleves ( Nom VARCHAR(100), Prénom VARCHAR(100), Age int, Lieu de résidence VARCHAR(100),);
- 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 'de résidence VARCHAR(100),)' at line 1
- mysql> CREATE TABLE liste_eleves ( Nom VARCHAR(100), Prénom VARCHAR(100), Age int, Lieu de résidence VARCHAR(100) );
- 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 'de résidence VARCHAR(100) )' at line 1
- mysql> CREATE TABLE liste_eleves ( Nom VARCHAR(100), Prenom VARCHAR(100), Age INT, Lieu_de_residence VARCHAR(100) );
- Query OK, 0 rows affected (1.32 sec)
- mysql> DROP TABLE
- -> DROP TABLE Eleves_WCS;
- 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 'DROP TABLE Eleves_WCS' at line 2
- mysql> DROP TABLE DROP TABLE Eleve_WCS;
- 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 'DROP TABLE Eleve_WCS' at line 1
- mysql> DROP TABLE Eleves_WCS;
- ERROR 1051 (42S02): Unknown table 'Eleves_WCS.Eleves_WCS'
- mysql> DROP TABLE Eleves_WCS;
- ERROR 1051 (42S02): Unknown table 'Eleves_WCS.Eleves_WCS'
- mysql> DESCRIBE Eleves_WCS
- -> DESCRIBE Eleves_WCS;
- 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 'DESCRIBE Eleves_WCS' at line 2
- mysql> DESCRIBE Eleves_WCS;
- ERROR 1146 (42S02): Table 'Eleves_WCS.Eleves_WCS' doesn't exist
- mysql> CREATE TABLE Eleves_WCS;
- ERROR 1113 (42000): A table must have at least 1 column
- mysql> CREATE TABLE Eleves_WCS (
- -> CREATE TABLE liste_eleves ( Nom VARCHAR(100), Prenom VARCHAR(100), Age INT, Lieu_de_residence VARCHAR(100) );^C^E^Z
- [2]+ Stopped mysql -u root -p
- antoine@PC-Antoine:~$ mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 7
- Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
- Copyright (c) 2000, 2016, 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> USE Eleves_WCS;
- 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> CREATE TABLE liste_eleves (
- -> Nom VARCHAR(100),
- -> Prenom VARCHAR(100),
- -> Age INT,
- -> Lieu_de_residence VARCHAR(100) );
- ERROR 1050 (42S01): Table 'liste_eleves' already exists
- mysql> DROP TABLE liste_eleves;
- Query OK, 0 rows affected (0.18 sec)
- mysql> CREATE TABLE liste_eleves ( ID INT PRIMARY KEY NOT NULL Nom VARCHAR(100), Prenom VARCHAR(100), Age INT, Lieu_de_residence VARCHAR(100) );
- 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 'Nom VARCHAR(100), Prenom VARCHAR(100), Age INT, Lieu_de_residence VARCHAR(100) )' at line 1
- mysql> CREATE TABLE liste_eleves ( ID INT PRIMARY KEY NOT NULL, Nom VARCHAR(100), Prenom VARCHAR(100), Age INT, Lieu_de_residence VARCHAR(100) );
- Query OK, 0 rows affected (0.34 sec)
- mysql> DESCRIBE liste_eleves
- -> ;
- +-------------------+--------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-------------------+--------------+------+-----+---------+-------+
- | ID | int(11) | NO | PRI | NULL | |
- | Nom | varchar(100) | YES | | NULL | |
- | Prenom | varchar(100) | YES | | NULL | |
- | Age | int(11) | YES | | NULL | |
- | Lieu_de_residence | varchar(100) | YES | | NULL | |
- +-------------------+--------------+------+-----+---------+-------+
- 5 rows in set (0.00 sec)
- mysql> INSERT INTO liste_eleves
- -> SELECT Nom
- -> FROM Eleves_WCS
- ->
- [3]+ Stopped mysql -u root -p
- antoine@PC-Antoine:~$ mysql -u root -p
- Enter password:
- Welcome to the MySQL monitor. Commands end with ; or \g.
- Your MySQL connection id is 8
- Server version: 5.7.17-0ubuntu0.16.04.1 (Ubuntu)
- Copyright (c) 2000, 2016, 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> USE Eleves_WCS
- 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> DESCRIBE liste_eleves
- -> ;
- +-------------------+--------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-------------------+--------------+------+-----+---------+-------+
- | ID | int(11) | NO | PRI | NULL | |
- | Nom | varchar(100) | YES | | NULL | |
- | Prenom | varchar(100) | YES | | NULL | |
- | Age | int(11) | YES | | NULL | |
- | Lieu_de_residence | varchar(100) | YES | | NULL | |
- +-------------------+--------------+------+-----+---------+-------+
- 5 rows in set (0.00 sec)
- mysql> SELECT *
- -> ;
- ERROR 1096 (HY000): No tables used
- mysql> INSERT INTO liste_eleves
- -> SELECT *
- -> FROM;
- 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 '' at line 3
- mysql> INSERT INTO liste_eleves VALUES ('THOMIRE', 'Antoine', 21, 'Bordeaux');
- ERROR 1136 (21S01): Column count doesn't match value count at row 1
- mysql> INSERT INTO liste_eleves ('Nom', 'Prenom', 'Age', 'Lieu_de_residence') VALUES ('THOMIRE', 'Antoine', 21, 'Bordeaux');
- 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 ''Nom', 'Prenom', 'Age', 'Lieu_de_residence') VALUES ('THOMIRE', 'Antoine', 21, '' at line 1
- mysql> INSERT INTO liste_eleves ('Nom', 'Prenom', Age, 'Lieu_de_residence') VALUES ('THOMIRE', 'Antoine', 21, 'Bordeaux');
- 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 ''Nom', 'Prenom', Age, 'Lieu_de_residence') VALUES ('THOMIRE', 'Antoine', 21, 'Bo' at line 1
- mysql> INSERT INTO liste_eleves (Nom, Prenom, Age, Lieu_de_residence) VALUES ('THOMIRE', 'Antoine', 21, 'Bordeaux');
- ERROR 1364 (HY000): Field 'ID' doesn't have a default value
- mysql> INSERT INTO liste_eleves (ID, Nom, Prenom, Age, Lieu_de_residence) VALUES (1, 'THOMIRE', 'Antoine', 21, 'Bordeaux');
- Query OK, 1 row affected (0.05 sec)
- mysql> DESCRIBE liste_eleves
- -> ;
- +-------------------+--------------+------+-----+---------+-------+
- | Field | Type | Null | Key | Default | Extra |
- +-------------------+--------------+------+-----+---------+-------+
- | ID | int(11) | NO | PRI | NULL | |
- | Nom | varchar(100) | YES | | NULL | |
- | Prenom | varchar(100) | YES | | NULL | |
- | Age | int(11) | YES | | NULL | |
- | Lieu_de_residence | varchar(100) | YES | | NULL | |
- +-------------------+--------------+------+-----+---------+-------+
- 5 rows in set (0.00 sec)
- mysql> INSERT INTO liste_eleves (Nom, Prenom, Age, Lieu_de_residence) VALUES ('VIGEANT', 'Alexandre', 19, 'Canejan');
- ERROR 1364 (HY000): Field 'ID' doesn't have a default value
- mysql> INSERT INTO liste_eleves (ID, Nom, Prenom, Age, Lieu_de_residence) VALUES (2, 'VIGEANT', 'Alexandre', 19, 'Canejan');
- Query OK, 1 row affected (0.08 sec)
- mysql> INSERT INTO liste_eleves (ID, Nom, Prenom, Age, Lieu_de_residence) VALUES (3, 'TIMAHIEU', 'Rebecca', 21, 'Le_Lardin');
- Query OK, 1 row affected (0.07 sec)
- mysql> INSERT INTO liste_eleves (ID, Nom, Prenom, Age, Lieu_de_residence) VALUES (4, 'GOOGLE', 'IsYourFriend', 18, 'Moutain_View');
- Query OK, 1 row affected (0.20 sec)
- mysql> INSERT INTO liste_eleves (ID, Nom, Prenom, Age, Lieu_de_residence) VALUES (5, 'Gami', 'Laurie', 23, 'Montcuq');
- Query OK, 1 row affected (0.12 sec)
- mysql>quit
- bye
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement