694
Python
Python 之自動獲取公網IP
0.預備知識
0.1 SQL基礎
ubuntu、Debian係列安裝:
1root@raspberrypi:~/python-script# apt-getinstallmysql-serverRedhat、Centos係列安裝:
1[root@localhost ~]#yuminstallmysql-server
登錄數據庫
1pi@raspberrypi:~ $ mysql -uroot -p -hlocalhost
2Enter password:3Welcome to the MariaDB monitor. Commands end with ; or \g.
4Your MariaDB connectionidis36
5Server version:10.0.30-MariaDB-+deb8u2 (Raspbian)
6
7Copyright (c)2000,2016, Oracle, MariaDB Corporation Ab and others.
8
9Type help; or \h forhelp. Type \c toclearthe current input statement.
10
11MariaDB [(none)]>
其中,mysql是客戶端命令-u是指定用戶-p是密碼-h是主機
創建數據庫、創建數據表
創建數據庫語法如下
1MariaDB [(none)]>help create database
2Name: CREATE DATABASE
3Description:
4Syntax:
5CREATE [IF NOT EXISTS] db_name
6[create_specification] ...
7
8create_specification:
9[DEFAULT] CHARACTER SET [=] charset_name
10| [DEFAULT] COLLATE [=] collation_name
11
12CREATE DATABASE creates a database with the given name. To use this
13statement, you need the CREATE privilegeforthe database. CREATE
14SCHEMA is a synonymforCREATE DATABASE.
15
16URL: https://mariadb.com/kb/en/create-database/
17
18
19MariaDB [(none)]>
最後更新:2017-10-09 18:41:31