当前位置: 首页 > news >正文

网站的栏目和版块设计的原则做中介卖房子开哪个网站

网站的栏目和版块设计的原则,做中介卖房子开哪个网站,是做网站设计好还是杂志美编好,福建省龙岩市建设培训中心网站1. 数据库管理系统 数据库是指按照某些特定结构来存储数据资料的数据仓库。在当今这个大数据技术迅速崛起的年代#xff0c;互联网上每天都会生成海量的数据信息#xff0c;数据库技术也从最初只能存储简单的表格数据的单一集中存储模式#xff0c;发展到了现如今存储海量…1.  数据库管理系统 数据库是指按照某些特定结构来存储数据资料的数据仓库。在当今这个大数据技术迅速崛起的年代互联网上每天都会生成海量的数据信息数据库技术也从最初只能存储简单的表格数据的单一集中存储模式发展到了现如今存储海量数据的大型分布式模式。在信息化社会中能够充分有效地管理和利用各种数据挖掘其中的价值是进行科学研究与决策管理的重要前提。同时数据库技术也是信息管理系统、办公自动化系统、决策支持系统等各类信息系统的核心组成部分是进行科学研究和决策管理的重要技术手段。  数据库管理系统是一种能够对数据库中存放的数据进行建立、修改、删除、查找、维护等操作的软件程序。它通过把计算机中具体的物理数据转换成适合用户理解的抽象逻辑数据有效地降低数据库管理的技术门槛因此即便是从事 Linux 运维工作的工程师也可以对数据库进行基本的管理操作。但是我们的技术主线依然是 Linux 系统的运维而数据库管理系统只不过是在此主线上的一个内容不断横向扩展、纵向加深的分支不能指望在一两天之内就可以精通数据库管理技术。 既然是讲解数据库管理技术就肯定绕不开 MySQL。MySQL 是一款市场占有率非常高的数据库管理系统技术成熟配置步骤相对简单而且具有良好的可扩展性。但是由于Oracle 公司在 2009年收购了 MySQL的母公司 Sun因此 MySQL数据库项目也随之纳入 Oracle麾下逐步演变为保持着开源软件的身份但又申请了多项商业专利的软件系统。开源软件是全球黑客、极客、程序员等技术高手在开源社区的大旗下的公共智慧的结晶自己的劳动成果被其他公司商业化自然也伤了一大批开源工作者的心因此 MySQL 项目的创始人重新研发了一款名为 MariaDB 的全新数据库管理系统。  2.  初始化 mariadb 服务  相较于 MySQLMariaDB 数据库管理系统有了很多新鲜的扩展特性例如对微秒级别的支持、线程池、子查询优化、进程报告等。在配置妥当软件仓库后即可安装部署 MariaDB数据库主程序及服务端程序了。 [rootlinuxprobe~]# dnf install -y mariadb mariadb-server Updating Subscription Management repositories. Unable to read consumer identity This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Last metadata expiration check: 0:00:19 ago on Tue 27 Apr 2021 05:04:27 PM CST. Dependencies resolved. Package Arch Version Repository Size Installing: mariadb x86_64 3:10.3.11-1.moduleel82765cfa4f87b AppStream 6.2 M mariadb-server x86_64 3:10.3.11-1.moduleel8cfa4f87b AppStream 16 M Installing dependencies: mariadb-common x86_64 3:10.3.11-1.moduleel8cfa4f87b AppStream 62 k mariadb-connector-c x86_64 3.0.7-1.el8 AppStream 148 k mariadb-connector-c-config noarch 3.0.7-1.el8 AppStream 13 k mariadb-errmsg x86_64 3:10.3.11-1.moduleel8cfa4f87b AppStream 232 k perl-DBD-MySQL x86_64 4.046-2.moduleel80650e81c AppStream 156 k Installing weak dependencies: mariadb-backup x86_64 3:10.3.11-1.moduleel8cfa4f87b AppStream 6.2 M mariadb-gssapi-server x86_64 3:10.3.11-1.module AppStream 49 k mariadb-server-utils x86_64 3:10.3.11-1.moduleel8 AppStream 1.6 M Enabling module streams: mariadb 10.3 perl-DBD-MySQL 4.046 Transaction Summary Install 10 Packages ………………省略部分输出信息……………… Installed: mariadb-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-server-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-backup-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-gssapi-server-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-server-utils-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-common-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 mariadb-connector-c-3.0.7-1.el8.x86_64 mariadb-connector-c-config-3.0.7-1.el8.noarch mariadb-errmsg-3:10.3.11-1.moduleel82765cfa4f87b.x86_64 perl-DBD-MySQL-4.046-2.moduleel825150650e81c.x86_64 Complete! 在安装完毕后记得启动服务程序并将其加入到开机启动项中  [rootlinuxprobe~]# systemctl start mariadb [rootlinuxprobe~]# systemctl enable mariadb Created symlink /etc/systemd/system/mysql.service→ /usr/lib/systemd/system/ mariadb.service. Created symlink /etc/systemd/system/mysqld.service→ /usr/lib/systemd/system/ mariadb.service. Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service→ / usr/lib/systemd/system/mariadb.service. 在确认 mariadb 数据库软件程序安装完毕并成功启动后请不要立即使用。为了确保数据库的安全性和正常运转需要先对数据库程序进行初始化操作。这个初始化操作涉及下面 5个步骤。  ➢  设置 root 管理员在数据库中的密码值注意该密码并非 root 管理员在系统中的密码这里的密码值默认应该为空可直接按回车键。  ➢  设置 root 管理员在数据库中的专有密码。  ➢  删除匿名用户并使用 root 管理员从远程登录数据库以确保数据库上运行的业务的安全性。  ➢  删除默认的测试数据库取消测试数据库的一系列访问权限。  ➢  刷新授权列表让初始化的设定立即生效。  对于上述数据库初始化的操作步骤已经在下面的输出信息旁边进行了简单注释确保各位读者更直观地了解要输入的内容  [rootlinuxprobe~]# mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, well need the current password for the root user. If youve just installed MariaDB, and you havent set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): 输入管理员原始密码默认为空值直接回车即可OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. Set root password? [Y/n] y 设置管理员密码 New password: 输入新的密码 Re-enter new password: 再次输入密码 Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y 删除匿名用户... Success! Normally, root should only be allowed to connect from localhost. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y 禁止管理员从远程登录... Success! By default, MariaDB comes with a database named test that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y 删除测试数据库及其权限- Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y 刷新授权表让初始化设定立即生效... Success! Cleaning up... All done! If youve completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! 在很多生产环境中都需要使用站库分离的技术即网站和数据库不在同一个服务器上如果需要让 root 管理员远程访问数据库可在上面的初始化操作中设置策略以允许 root 管理员从远程访问。然后还需要设置防火墙使其放行对数据库服务程序的访问请求。数据库服务程序默认会占用 3306 端口在防火墙策略中服务名称统一叫作 mysql  [rootlinuxprobe~]# firewall-cmd --permanent --add-servicemysql success [rootlinuxprobe~]# firewall-cmd --reload success 一切准备就绪。现在我们将首次登录 MariaDB 数据库。管理数据库的命令为 mysql其中-u 参数用来指定以 root 管理员的身份登录而-p 参数用来验证该用户在数据库中的密码值。  [rootlinuxprobe~]# mysql -u root -p Enter password: 输入刚才设置的管理员密码后敲击回车 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 16 Server version: 10.3.11-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type help; or \h for help. Type \c to clear the current input statement. 初次使用数据库管理工具的读者可以输入 help 命令查看 mariadb 服务能做的操作语句的用法与 MySQL 一模一样  MariaDB [(none)] help General information about MariaDB can be found at http://mariadb.org List of all MySQL commands: Note that all text commands must be first on line and end with ; ? (\?) Synonym for help. clear (\c) Clear the current input statement. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Dont write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Dont show warnings after every statement. For server side help, type help contents 在登录 MariaDB 数据库后执行数据库命令时都需要在命令后面用分号;结尾这也是与 Linux 命令最显著的区别。大家需要慢慢习惯数据库命令的这种设定。下面执行如下命令查看数据库管理系统中当前都有哪些数据库  MariaDB [(none)] SHOW databases; -------------------- | Database | -------------------- | information_schema | | mysql | | performance_schema | -------------------- 3 rows in set (0.000 sec ) 小试牛刀过后接下来使用数据库命令将 root 管理员在数据库管理系统中的密码值修改为 linuxprobe。这样退出后再尝试登录如果还坚持输入原先的密码则将提示访问失败。  MariaDB [(none)] SET password PASSWORD(linuxprobe); Query OK, 0 rows affected (0.001 sec) MariaDB [(none)] exit Bye [rootlinuxprobe~]# mysql -u root -p Enter password: 此处输入管理员在数据库中的旧密码 ERROR 1045 (28000): Access denied for user rootlocalhost (using password: YES) 输入新密码linuxprobe后便可顺利进入数据库管理工具中  [rootlinuxprobe~]# mysql -u root -p Enter password: 此处输入管理员在数据库中的新密码 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 20 Server version: 10.3.11-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type help; or \h for help. Type \c to clear the current input statement. 3.  管理用户以及授权  在生产环境中总不能一直“死啃”root 管理员。为了保障数据库系统的安全性以及让其他用户协同管理数据库可以在 MariaDB 数据库管理系统中为他们创建多个专用的数据库管理用户然后再分配合理的权限以满足他们的工作需求。为此可使用 root 管理员登录数据库管理系统然后按照“CREATE USER 用户名主机名 IDENTIFIED BY 密码;”的格式创建数据库管理用户。再次提醒大家一定不要忘记每条数据库命令后面的分号;。 MariaDB [(none)] CREATE USER lukelocalhost IDENTIFIED BY linuxprobe; Query OK, 0 rows affected (0.00 sec) 创建的用户信息可以使用 SELECT 命令语句来查询。下面命令查询的是用户 luke 的主机名称、用户名称以及经过加密的密码值信息  MariaDB [(none)] use mysql; Database changed MariaDB [mysql] SELECT HOST,USER,PASSWORD FROM user WHERE USERluke; ------------------------------------------------------------ | HOST | USER | PASSWORD | ------------------------------------------------------------ | localhost | luke | *55D9962586BE75F4B7D421E6655973DB07D6869F | ------------------------------------------------------------ 1 row in set (0.001 sec) 不过用户 luke 仅仅是一位普通用户没有数据库的任何操作权限。不信的话可以切换到 luke 用户来查询数据库管理系统中当前都有哪些数据库。可以发现该用户甚至没法查看完整的数据库列表刚才使用 root 用户时可以查看到 3 个数据库列表  MariaDB [mysql] exit Bye [rootlinuxprobe~]# mysql -u luke -p Enter password: 输入luke用户的数据库密码 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 21 Server version: 10.3.11-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type help; or \h for help. Type \c to clear the current input statement. MariaDB [(none)] SHOW databases; -------------------- | Database | -------------------- | information_schema | -------------------- 1 row in set (0.001 sec) 数据库管理系统所使用的命令一般都比较复杂。我们以 GRANT 命令为例进行说明。GRANT 命令用于为用户进行授权其常见格式如表所示。在使用 GRANT 命令时需要写上要赋予的权限、数据库及表单名称以及对应的用户及主机信息。其实只要理解了命令中每个字段的功能含义也就不觉得命令复杂难懂了。  当然用户的授权工作肯定是需要数据库管理员来执行的。下面以 root 管理员的身份登录到数据库管理系统中针对 mysql 数据库中的 user 表单向用户 luke 授予查询、更新、删除以及插入等权限。  [rootlinuxprobe~]# mysql -u root -p Enter password: 输入管理员的数据库密码 MariaDB [(none)] use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed MariaDB [mysql] GRANT SELECT,UPDATE,DELETE,INSERT ON mysql.user TO lukelocalhost; Query OK, 0 rows affected (0.001 sec) 在执行完上述授权操作之后我们再查看一下用户 luke 的权限  MariaDB [(none)] SHOW GRANTS FOR lukelocalhost; ------------------------------------------------------------------ | Grants for lukelocalhost | ------------------------------------------------------------------ | GRANT USAGE ON *.* TO lukelocalhost IDENTIFIED BY PASSWORD *55D9962586BE75F4B7D421E6655973DB07D6869F | | GRANT SELECT, INSERT, UPDATE, DELETE ON mysql.user TO lukelocalhost | ----------------------------------------------------------------------------- 2 rows in set (0.000 sec) 上面输出信息中显示用户 luke已经拥有了针对mysql 数据库中 user 表单的一系列权限了。这时我们再切换到用户 luke此时就能够看到 mysql 数据库了而且还能看到表单 user其余表单会因无权限而被继续隐藏  [rootlinuxprobe~]# mysql -u luke -p Enter password: 输入luke用户的数据库密码 MariaDB [(none)] SHOW databases; -------------------- | Database | -------------------- | information_schema | | mysql | -------------------- 2 rows in set (0.000 sec) MariaDB [(none)] use mysql; Database changed MariaDB [mysql] SHOW tables; ----------------- | Tables_in_mysql | ----------------- | user | ----------------- 1 row in set (0.001 sec) MariaDB [mysql] exit Byes 大家不要心急我们接下来会慢慢学习数据库内容的修改方法。当前先切换回 root 管理员用户移除刚才的授权。  [rootlinuxprobe~]# mysql -u root -p Enter password: 输入管理员的数据库密码 MariaDB [(none)] use mysql; Database changed MariaDB [(none)] REVOKE SELECT,UPDATE,DELETE,INSERT ON mysql.user FROM lukelocalhost; Query OK, 0 rows affected (0.00 sec) 可以看到除了移除授权的命令REVOKE与授权命令GRANTS不同之外其余部分都是一致的。这不仅好记而且也容易理解。执行移除授权命令后再来查看用户 luke 的信息  MariaDB [(none)] SHOW GRANTS FOR lukelocalhost; ----------------------------------------------------------------- | Grants for lukelocalhost | ----------------------------------------------------------------- | GRANT USAGE ON *.* TO lukelocalhost IDENTIFIED BY PASSWORD *55D9962586BE75F4B7D421E6655973DB07D6869F | ------------------------------------------------------------------ 1 row in set (0.001 sec) 不再需要某个用户时可以直接用 DROP 命令将其删除 MariaDB [(none)] DROP user lukelocalhost; Query OK, 0 rows affected (0.000 sec) 4.  创建数据库与表单  在 MariaDB 数据库管理系统中一个数据库可以存放多个数据表数据表单是数据库中最重要最核心的内容。我们可以根据自己的需求自定义数据库表结构然后在其中合理地存放数据以便后期轻松地维护和修改。表罗列了后文中将使用到的数据库命令以及对应的作用。  建立数据库是管理数据的起点。现在尝试创建一个名为 linuxprobe 的数据库然后再查看数据库列表此时就能看到它了  MariaDB [(none)] CREATE DATABASE linuxprobe; Query OK, 1 row affected (0.001 sec) MariaDB [(none)] SHOW databases; -------------------- | Database | -------------------- | information_schema | | linuxprobe | | mysql | | performance_schema | -------------------- 4 rows in set (0.001 sec) MariaDB 与 MySQL 同属于关系型数据库Relational  Database  Management  SystemRDBMS。关系型数据库有些类似于表格的概念一个关系型数据库由一个或多个表格/表单组成如图 18-2 所示。  在图 18-2 中表头表示每一列的名称列表示具有相同数据类型的数据集合行表示用来描述事物的具体信息值表示行的具体信息每个值均与该列的其他数据类型相同键表示用来识别某个特定事物的方法在当前列中具有唯一性。  比如在新建的 linuxprobe 数据库中创建表单 mybook然后进行表单的初始化即定义存储数据内容的结构。我们分别定义 3 个字段项其中字符型字段 name长度为 15 字符用来存放图书名称整型字段 price 和 pages 分别存储图书的价格和页数。当执行完下述命令之后就可以看到表单的结构信息了  MariaDB [(none)] use linuxprobe; Database changed MariaDB [linuxprobe] CREATE TABLE mybook (name char(15),price int,pages int); Query OK, 0 rows affected (0.009 sec) MariaDB [linuxprobe] DESCRIBE mybook; -------------------------------------------- | Field | Type | Null | Key | Default | Extra | -------------------------------------------- | name | char(15) | YES | | NULL | | | price | int(11) | YES | | NULL | | | pages | int(11) | YES | | NULL | | -------------------------------------------- 3 rows in set (0.002 sec) 5.  管理表单及数据 接下来向 mybook 数据表单中插入一条图书信息。为此需要使用 INSERT 命令并在命令中写清表单名称以及对应的字段项。执行该命令之后即可完成图书写入信息。下面使用该命令插入一条图书信息其中书名为 linuxprobe价格和页数分别是 60 元和 518 页。在命令执行后也就意味着图书信息已经成功写入到数据表单中然后就可以查询表单中的内容了。在使用 SELECT 命令查询表单内容时需要加上想要查询的字段如果想查看表单中的所有内容则可以使用星号*通配符来显示  MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxprobe,60, 518); Query OK, 1 row affected (0.001 sec) MariaDB [linuxprobe] SELECT * from mybook; -------------------------- | name | price | pages | -------------------------- | linuxprobe | 60 | 518 | -------------------------- 1 row in set (0.000 sec) 对数据库运维人员来讲需要做好 4 门功课—增、删、改、查。这意味着创建数据表单并在其中插入内容仅仅是第一步还需要掌握数据表单内容的修改方法。例如可以使用UPDATE 命令将刚才插入的 linuxprobe 图书信息的价格修改为 55 元然后再使用 SELECT 命令查看该图书的名称和定价信息。注意因为这里只查看图书的名称和定价而不涉及页码所以无须再用星号通配符来显示所有内容。  MariaDB [linuxprobe] UPDATE mybook SET price55 ; Query OK, 1 row affected (0.002 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [linuxprobe] SELECT name,price FROM mybook; ------------------- | name | price | ------------------- | linuxprobe | 55 | ------------------- 1 row in set (0.000 sec) 想修改指定的某一条记录没问题的用 WHERE 命令进行限定即可。我们先插入两条图书信息  MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxcool,85, 300); Query OK, 1 row affected (0.001 sec) MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxdown,105, 500); Query OK, 1 row affected (0.001 sec) 然后使用 WHERE 命令仅将名称为 linuxcool 的图书价格修改为 60 元不影响其他图书信息  MariaDB [linuxprobe] UPDATE mybook SET price60 where namelinuxcool; Query OK, 1 row affected (0.001 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [linuxprobe] select * from mybook; -------------------------- | name | price | pages | -------------------------- | linuxprobe | 55 | 518 | | linuxcool | 60 | 300 | | linuxdown | 105 | 500 | -------------------------- 3 rows in set (0.001 sec) 还可以使用 DELETE 命令删除某个数据表单中的内容。下面使用 DELETE 命令删除数据表单 mybook 中的所有内容然后再查看该表单中的内容可以发现该表单内容为空了  MariaDB [linuxprobe] DELETE FROM mybook; Query OK, 3 row affected (0.001 sec) MariaDB [linuxprobe] SELECT * FROM mybook; Empty set (0.000 sec) 一般来讲数据表单中会存放成千上万条数据信息。比如我们刚刚创建的用于保存图书信息的 mybook 表单随着时间的推移里面的图书信息也会越来越多。在这样的情况下如果只想查看其价格大于某个数值的图书又该如何定义查询语句呢  下面先使用 INSERT 插入命令依次插入 4 条图书信息  MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxprob e1,30,518); Query OK, 1 row affected (0.05 sec) MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxprob e2,50,518); Query OK, 1 row affected (0.05 sec) MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxprob e3,80,518); Query OK, 1 row affected (0.01 sec) MariaDB [linuxprobe] INSERT INTO mybook(name,price,pages) VALUES(linuxprobe 4,100,518); Query OK, 1 row affected (0.00 sec) 要想让查询结果更加精准就需要结合使用 SELECT 与 WHERE 命令了。其中WHERE命令是在数据库中进行匹配查询的条件命令。通过设置查询条件就可以仅查找出符合该条件的数据。表 18-3 列出了 WHERE 命令中常用的查询参数以及作用。  现在进入动手环节。分别在 mybook 表单中查找出价格大于 75 元或价格不等于 80 元的图书其对应的命令如下所示。在熟悉了这两个查询条件之后大家可以自行尝试精确查找图书名为 linuxprobe2 的图书信息。  MariaDB [linuxprobe] SELECT * FROM mybook WHERE price75; --------------------------- | name | price | pages | --------------------------- | linuxprobe3 | 80 | 518 | | linuxprobe4 | 100 | 518 | --------------------------- 2 rows in set (0.001 sec) MariaDB [linuxprobe] SELECT * FROM mybook WHERE price!80; --------------------------- | name | price | pages | --------------------------- | linuxprobe1 | 30 | 518 | | linuxprobe2 | 50 | 518 | | linuxprobe4 | 100 | 518 | --------------------------- 3 rows in set (0.000 sec) 匹配的条件越多获得的信息就越精准。在 WHERE 命令的后面追加 AND 操作符可以进行多次匹配。例如执行下述命令找到价格为 30 元、页数为 518 的图书的名称  MariaDB [linuxprobe] SELECT * from mybook WHERE price30 AND pages518 ; --------------------------- | name | price | pages| --------------------------- | linuxprobe1 | 30 | 518 | --------------------------- 1 row in set (0.000 sec) 6.  数据库的备份及恢复 前文提到本书的技术主线是 Linux 系统的运维方向不会对数据库管理系统的操作进行深入的讲解因此大家掌握了上面这些基本的数据库操作命令之后就足够了。下面要讲解的是数据库的备份以及恢复这些知识比较实用希望大家能够掌握。  mysqldump 命令用于备份数据库数据格式为“mysqldump [参数] [数据库名称]”。其中参数与 mysql 命令大致相同-u 参数用于定义登录数据库的用户名称-p 参数表示密码提示符。下面将 linuxprobe 数据库中的内容导出为一个文件并保存到 root 管理员的家目录中 [rootlinuxprobe~]# mysqldump -u root -p linuxprobe /root/linuxprobeDB.dump Enter password: 输入管理员的数据库密码 然后进入 MariaDB 数据库管理系统彻底删除 linuxprobe 数据库这样 mybook 数据表单也将被彻底删除。然后重新建立 linuxprobe 数据库  [rootlinuxprobe~]# mysql -u root -p Enter password: 输入管理员的数据库密码 MariaDB [(none)] DROP DATABASE linuxprobe; Query OK, 1 row affected (0.04 sec) MariaDB [(none)] SHOW databases; -------------------- | Database | -------------------- | information_schema | | mysql | | performance_schema | -------------------- 3 rows in set (0.02 sec) MariaDB [(none)] CREATE DATABASE linuxprobe; Query OK, 1 row affected (0.00 sec) 接下来是见证数据恢复效果的时刻使用输入重定向符把刚刚备份的数据库文件导入到mysql 命令中然后执行该命令。接下来登录 MariaDB 数据库就又能看到 linuxprobe 数据库以及 mybook 数据表单了。数据库恢复成功 [rootlinuxprobe~]# mysql -u root -p linuxprobe /root/linuxprobeDB.dump Enter password: 输入管理员的数据库密码 [rootlinuxprobe~]# mysql -u root -p Enter password: 输入管理员的数据库密码 MariaDB [(none)] use linuxprobe; Database changed MariaDB [linuxprobe] SHOW tables; ---------------------- | Tables_in_linuxprobe | ---------------------- | mybook | ---------------------- 1 row in set (0.000 sec) MariaDB [linuxprobe] describe mybook; -------------------------------------------- | Field | Type | Null | Key | Default | Extra | -------------------------------------------- | name | char(15) | YES | | NULL | | | price | int(11) | YES | | NULL | | | pages | int(11) | YES | | NULL | | -------------------------------------------- 3 rows in set (0.002 sec)
http://www.dnsts.com.cn/news/26043.html

相关文章:

  • 做竞价网站需要什么样的空间彩页设计教程
  • 新手建什么网站赚钱吗个人外贸平台有哪些
  • 彩票网站开发dadi163北京公司注册流程及资料
  • 男女性做那个微视频网站小程序如何快速推广
  • 宁夏网站设计聊城网站建设品牌
  • 佛山市企业网站建设哪家好ps个人网页设计教程
  • 怎么用网网站模板做网站湛江市住房和城乡建设网站
  • 荥阳网站推广管理咨询师证书含金量
  • 云南政务网站建设谢岗仿做网站
  • 网站做淘客网站开发脚本语言
  • 建立网站的目的网站一级导航怎么做
  • 安顺市哪里可以做网站seo代码优化工具
  • 合浦县城乡规划建设局网站纪检网站建设计划书
  • 蕴川路上海网站建设最新新闻热点素材
  • 工业设计在线网站网站开发部署
  • 中山市饮食网站建设网站建设广州公司哪家好
  • 网站制作手机版手机网页及网站设计
  • 购物网站建设平台网站推广软件哪家好
  • 免备案做网站可以盈利吗wordpress 弹幕插件
  • 珠海公司网站制作化妆品网站建设实施背景
  • 东莞网站建设设公司网页设计培训课程
  • 方正隶变简体可以做网站用么成都优化官网公司
  • 卖产品怎么做网站山西省建设工程招投标监督网站
  • ICP备案域名网站石灰土做击实检测网站怎么填
  • 网上购物网站建设公司wordpress导航栏二级层自定义
  • 婚纱摄影网站论文深圳网络营销的推广
  • 网站运营 策划 推广 维护动漫设计与制作属于什么专业大类
  • 商城网站开发多少钱厦门网站建设服务
  • 瑶海区网站建设公司xiamiplayer for wordpress
  • 太原在线制作网站什么叫子网站