搜索
首页数据库mysql教程OurSQL Episode 191: Common Schema, part 1_MySQL

This week we start talking about common schema by Shlomi Noach. Ear Candy is some caveats about GTIDs and replication, and At the Movies is using jQuery, AJAX and PHP to insert data into MySQL.

News

In the news, the OurSQL podcast will change to a monthly format after episode 200. We love doing the podcast, but it is very time consuming and production is expensive. We will still bring quality episodes, they will just be spaced further apart.

Common Schema

Common SchemaGoogle Code page

Installation sectionof the common schema documentation.

  • Process Routines- stored routines managing query, session and process information & workflow
    • session_unique_id()
    • query_latptime()
    • query_runtime()
    • this_query()
    • throttle()- some good examples here
  • General Routines- stored routines mostly dealing with checksums
    • crc64()- returns a crc64 checksum of the data given
    • query_checksum()- return a checksum of the results of the query specified
    • random_hash()
    • shorttime_to_seconds- converts human readable "short times" like 1h, 45m, and so on to a number of seconds
  • Query Analysis Routines- takes in the name of a schema and an object (event, routine, SQL statement or view) and returns a summary of the objects the given object involves, the type and schema for each dependent object
    • get_event_dependencies()- for events
    • get_routine_dependencies()- for stored functions and stored procedures
    • get_sql_dependencies()- for SQL statements
    • get_view_dependencies()- for views
    • Example of get_routine_dependencies():

      CALL common_schema.get_routine_dependencies( 'common_schema', 'get_routine_dependencies');

      +-------------+--------------------+-----------+------+

      | schema_name | object_name | object_type | action |

      +-------------+--------------------+-----------+------+

      | common_schema | get_sql_dependencies | procedure | call |

      | mysql | proc | table | select |

      +-------------+--------------------+-----------+------+

      2 rows in set (0.07 sec)

    • Schema Analysis Routines
      • table_exists()
      • table_rotate()- rotate a table in logrotate format
    • Security Routines
      • duplicate_grantee()- create a new user with the same privileges as an existing user
      • grant_access()- grant SELECT and EXECUTE on common_schema items to the user listed
      • match_grantee()- match a specified user@host with an entry in the mysql.user table
        For example, from PROCESSLIST:
        SELECT id, common_schema.mysql_grantee(user, host) FROM information_schema.processlist;
      • mysql_grantee()- return a qualified, valid mysql user from the information given
      • killall()
      • security_audit()- find unsecure accounts
    • Date and Time Routines
      • start_of_hour()
      • start_of_week()
      • start_of_week_sunday()
      • start_of_month()
      • start_of_quarter()
      • start_of_year()
      • is_datetime()
      • easter_day()
    • Charting Routines
      • line_chart()
      • google_line_chart()

      Common Schema risks

      Ear Candy

      In this week's ear candy we discussreplication challenges with GTIDs.

      At the movies

      This week in at the movies, we present a video on how toInsert Data Into MySQL Database using jQuery + AJAX + PHP

      Where you can see us

      Sheeri will be at theJuly Boston MySQL User Groupon Monday, July 14th, where we'll have David Berube talking about "Improving Your Database Designs with Practical Database Theory"..

      Gerry will be at theJuly Seattle MySQL User Groupon Monday, July 14th.

      Sheeri will be attending theTDWI Executive Summitin Boston from Sunday July 20th through Wednesday July 23rd.

      Gerry will be attendingOSCon 2014from Sunday July 20th through Thursday July 24th.

      Feedback

      Facebook group

      Google+ page

      e-mail: podcast at technocation.org

      voicemail using phone/Skype: +1-617-674-2369

      twitter:@oursqlcast

      orTweet about @oursqlcast

      Trackback URL for this post:

      http://technocation.org/trackback/1323

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
MySQL和其他SQL方言之间的语法有什么区别?MySQL和其他SQL方言之间的语法有什么区别?Apr 27, 2025 am 12:26 AM

mysqldiffersfromothersqldialectsinsyntaxforlimit,自动启动,弦乐范围,子征服和表面上分析。1)MySqluessLipslimit,whilesqlserverusestopopandoraclesrontersrontsrontsrontsronnum.2)

什么是mysql分区?什么是mysql分区?Apr 27, 2025 am 12:23 AM

MySQL分区能提升性能和简化维护。1)通过按特定标准(如日期范围)将大表分成小块,2)物理上将数据分成独立文件,3)查询时MySQL可专注于相关分区,4)查询优化器可跳过不相关分区,5)选择合适的分区策略并定期维护是关键。

您如何在MySQL中授予和撤销特权?您如何在MySQL中授予和撤销特权?Apr 27, 2025 am 12:21 AM

在MySQL中,如何授予和撤销权限?1.使用GRANT语句授予权限,如GRANTALLPRIVILEGESONdatabase_name.TO'username'@'host';2.使用REVOKE语句撤销权限,如REVOKEALLPRIVILEGESONdatabase_name.FROM'username'@'host',确保及时沟通权限变更。

说明InnoDB和Myisam存储引擎之间的差异。说明InnoDB和Myisam存储引擎之间的差异。Apr 27, 2025 am 12:20 AM

InnoDB适合需要事务支持和高并发性的应用,MyISAM适合读多写少的应用。1.InnoDB支持事务和行级锁,适用于电商和银行系统。2.MyISAM提供快速读取和索引,适合博客和内容管理系统。

MySQL中有哪些不同类型的连接?MySQL中有哪些不同类型的连接?Apr 27, 2025 am 12:13 AM

MySQL中有四种主要的JOIN类型:INNERJOIN、LEFTJOIN、RIGHTJOIN和FULLOUTERJOIN。1.INNERJOIN返回两个表中符合JOIN条件的所有行。2.LEFTJOIN返回左表中的所有行,即使右表中没有匹配的行。3.RIGHTJOIN与LEFTJOIN相反,返回右表中的所有行。4.FULLOUTERJOIN返回两个表中所有符合或不符合JOIN条件的行。

MySQL中有哪些不同的存储引擎?MySQL中有哪些不同的存储引擎?Apr 26, 2025 am 12:27 AM

mysqloffersvariousStorageengines,每个suitedfordferentusecases:1)InnodBisidealForapplicationsNeedingingAcidComplianCeanDhighConcurncurnency,supportingtransactionsancions and foreignkeys.2)myisamisbestforread-Heavy-Heavywyworks,lackingtransactionsactionsacupport.3)记忆

MySQL中有哪些常见的安全漏洞?MySQL中有哪些常见的安全漏洞?Apr 26, 2025 am 12:27 AM

MySQL中常见的安全漏洞包括SQL注入、弱密码、权限配置不当和未更新的软件。1.SQL注入可以通过使用预处理语句防止。2.弱密码可以通过强制使用强密码策略避免。3.权限配置不当可以通过定期审查和调整用户权限解决。4.未更新的软件可以通过定期检查和更新MySQL版本来修补。

您如何确定MySQL中的慢速查询?您如何确定MySQL中的慢速查询?Apr 26, 2025 am 12:15 AM

在MySQL中识别慢查询可以通过启用慢查询日志并设置阈值来实现。1.启用慢查询日志并设置阈值。2.查看和分析慢查询日志文件,使用工具如mysqldumpslow或pt-query-digest进行深入分析。3.优化慢查询可以通过索引优化、查询重写和避免使用SELECT*来实现。

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热工具

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

适用于 Eclipse 的 SAP NetWeaver 服务器适配器

将Eclipse与SAP NetWeaver应用服务器集成。

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

EditPlus 中文破解版

EditPlus 中文破解版

体积小,语法高亮,不支持代码提示功能