Remind:
When you create a table for MYSQL, the symbol outside the table name and field name is not a single quotation mark, but an inverted single quote in the state of the English IME, and the ~ button below the ESC key in the upper-left corner of the keyboard.
The Terminator in each statement is '; '
First, the command line to build the library table
[Email protected] ~]# mysql-uroot-p
Enter Password:
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MySQL Connection ID is 36
Server Version:5.7.18-log Source Distribution
Copyright (c), Oracle, MariaDB Corporation Ab and others.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
MySQL [(None)]> CREATE Database Linuxview;
Query OK, 1 row Affected (0.00 sec)
MySQL [(None)]> use Linuxview;
Database changed
MySQL [linuxview]> CREATE TABLE lv1 (ID int (4), name varchar (TEN), Mark varchar) engine=innodb default Charset=utf8;
Query OK, 0 rows affected (0.40 sec)
MySQL [linuxview]> Show tables;
+---------------------+
| Tables_in_linuxview |
+---------------------+
| Lv1 |
+---------------------+
1 row in Set (0.00 sec)
MySQL [linuxview]>
Description
If you do not want the field to be empty, you can add not null after the field property, and when the data is inserted, a null error will be added.
Engine Set Search Engines
CharSet Setting the encoding
Second, PHP Build library table
Grammar:
Mysqli_query (Connection,query,resultmode);
{
Die (' Create DATABASE failed: '. Mysqli_query ($conn));
}
echo "Create data table successfully \ n";
Mysqli_close ($conn);
?>
[Email protected] web]#
Effect:
To view the database:
MySQL [(None)]> use viewtest;
Database changed
MySQL [viewtest]> Show tables;
+--------------------+
| Tables_in_viewtest |
+--------------------+
| Lv1 |
+--------------------+
1 row in Set (0.00 sec)
MySQL [viewtest]>
DBA: Multi-mode Library Table database table