跟老齐学Python之网站的结构(3)
除了上面的安装过程,看官如果用的是别的操作系统,可以在google上搜索相应的安装方法,恕我不在这里演示,因为我只能演示在ubuntu上的安装流程。不过,google会帮你解决安装遇到的问题。
运行mysql
安装之后,就要运行它,并操作这个数据库,建立一个做网站的基础。我这样来运行数据库:
qw@qw-Latitude-E4300:~$ mysql -u root -p
Enter password:
输入数据库的密码,之后出现:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 373
Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, 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>
看到这个界面内容,就说明你已经进入到数据里面了。接下来就可以对这个数据进行操作。例如:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| carstore |
| cutvideo |
| itdiffer |
| mysql |
| performance_schema |
| phpcms |
| phpcms2 |
| pushsystem |
| sipras |
| test |
+--------------------+
用这个命令,就列出了当前mysql已经有的数据库。
除了这种用命令行形式对数据库进行操作之外,还有不少可视化方式操作数据库的工具。这里也不作介绍,有兴趣的请google。不过,我喜欢命令行。