DBA: Multi-mode Library Table database table

Source: Internet
Author: User
Tags dba

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.