阅读694 返回首页    go 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

  上一篇:go Python安装中需要特别注意的一件事
  下一篇:go Python note