Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Mastering MariaDB
Mastering MariaDB

Mastering MariaDB: Debug, secure, and back up your data for optimum server performance with MariaDB

eBook
$22.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Mastering MariaDB

Chapter 2. Debugging

In this chapter, we will discuss the basic techniques that can be used to find problems in the MariaDB server and in SQL statements. The following are some of the basic tools and techniques used:

  • Error conditions
  • The diagnostics area
  • The error log
  • The general query log
  • Maintaining logs
  • The SQL_ERROR_LOG plugin
  • Debugging of stored programs

Understanding error conditions in MariaDB

Before discussing the database debugging techniques, it is important to understand the most important tools used by MariaDB that notify us about error conditions, that is, when something goes wrong.

An error in MariaDB consists of the following types of data:

  • A SQLSTATE value
  • An error number
  • An error message

While conditions are usually generated by the server, the user can raise them using the SIGNAL and RESIGNAL SQL statements.

To get information about errors, the C API provides three methods: mysql_sqlstate(), mysql_errno(), and mysql_error(). Most MariaDB or MySQL APIs have corresponding methods with almost identical names. These methods and statements will be discussed later in this chapter. Now, let's discuss the MariaDB errors.

The SQLSTATE value

The SQLSTATE value is an alphanumerical string of five characters. The first two characters represent a class and provide general information about the problem. The last three characters represent...

The diagnostics area

The diagnostics area consists of two subareas: the statement information and the condition information.

The statement information contains two values:

  • NUMBER: This is the number of conditions stored in the condition area.
  • ROW_COUNT: This is the number of rows modified by the statement it refers to. The same value is returned by the ROW_COUNT() SQL function and by the mysql_affected_rows() API function.

The diagnostics area is populated and emptied by following the exact rules. Knowing these rules is very important to debug single statements without falling for some common pitfalls, and it is more important to debug the stored programs.

Whenever a statement generates at least one condition (notes, warnings, or errors), the diagnostics area is populated with such conditions. Any condition present previously in the diagnostics area is deleted. However, there is an exception. If the new statement is RESIGNAL or GET DIAGNOSTICS, the old conditions are not deleted. This is to...

The GET DIAGNOSTICS statement

The GET DIAGNOSTICS statement is a good way to show the structure of the diagnostics area because it can copy each value into a variable.

It has a verbose and an error-prone syntax, but it is the only way to analyze the diagnostics area within a stored program. In fact, SHOW WARNINGS returns a result set to the client but does not allow the SQL code to access it. The HANDLER block is executed when an exact error or a class of errors occurs, but it does not provide information about the problem. The reader is expected to be familiar with the stored programs. However, some examples of the use of GET DIAGNOSTICS are useful to demonstrate the contents of the diagnostics area.

First, let's populate the diagnostics area with two errors. For this, we will use the same statements of the previous example:

MariaDB [(none)]> SET sql_mode = 'x';
ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'x'
MariaDB [(none...

The error log

The error log contains information about a server's startup and shutdown as well as any critical errors that the server encounters. This includes problems that stop the server or prevent a plugin from starting as well as data corruptions. The log can be enabled or disabled.

Note

The error log is a file and is located in the data directory by default. Its default name is the server's hostname with the .err extension. Using the default name may not be a good idea in a replication environment as all servers have different hostnames, and the administrator may prefer to have identical names for all log files.

On Windows, the error log is enabled by default. If it is explicitly disabled, the errors can be shown on the console using the --console option. Note that this does not work if the --log-error option is present.

Tip

On Linux and Unix systems, the error log is disabled by default. In this case, the errors are written on stderr unless the output is redirected to another...

System logs

If mysqld_safe is invoked with the --syslog option, the errors are also logged in the system log (syslog). This feature works only if the system has the logger program, which is usually present on Linux systems, and in such cases, the daemon facility is used. By default, each syslog entry has a mysqld or mysqld_safe tag, depending on the program that generated its entry. If multiple instances of MariaDB (or MySQL) are running on the same system, it is advisable to add a different suffix for each instance to find out which particular instance logged a particular error. To do this, you can start mysqld_safe with the --syslog-tag option, as shown in the following example:

mysqld_safe --syslog --syslog-tag=serv1

In this case, the errors will be logged in the syslog, and the tags will be mysqld-serv1 and mysqld_safe-serv1. However, this option is usually set in the my.cnf file in the server's directory. In this case, the syslog and syslog_tag options must be written in the ...

Understanding error conditions in MariaDB


Before discussing the database debugging techniques, it is important to understand the most important tools used by MariaDB that notify us about error conditions, that is, when something goes wrong.

An error in MariaDB consists of the following types of data:

  • A SQLSTATE value

  • An error number

  • An error message

While conditions are usually generated by the server, the user can raise them using the SIGNAL and RESIGNAL SQL statements.

To get information about errors, the C API provides three methods: mysql_sqlstate(), mysql_errno(), and mysql_error(). Most MariaDB or MySQL APIs have corresponding methods with almost identical names. These methods and statements will be discussed later in this chapter. Now, let's discuss the MariaDB errors.

The SQLSTATE value

The SQLSTATE value is an alphanumerical string of five characters. The first two characters represent a class and provide general information about the problem. The last three characters represent a subclass...

The diagnostics area


The diagnostics area consists of two subareas: the statement information and the condition information.

The statement information contains two values:

  • NUMBER: This is the number of conditions stored in the condition area.

  • ROW_COUNT: This is the number of rows modified by the statement it refers to. The same value is returned by the ROW_COUNT() SQL function and by the mysql_affected_rows() API function.

The diagnostics area is populated and emptied by following the exact rules. Knowing these rules is very important to debug single statements without falling for some common pitfalls, and it is more important to debug the stored programs.

Whenever a statement generates at least one condition (notes, warnings, or errors), the diagnostics area is populated with such conditions. Any condition present previously in the diagnostics area is deleted. However, there is an exception. If the new statement is RESIGNAL or GET DIAGNOSTICS, the old conditions are not deleted. This is to...

The GET DIAGNOSTICS statement


The GET DIAGNOSTICS statement is a good way to show the structure of the diagnostics area because it can copy each value into a variable.

It has a verbose and an error-prone syntax, but it is the only way to analyze the diagnostics area within a stored program. In fact, SHOW WARNINGS returns a result set to the client but does not allow the SQL code to access it. The HANDLER block is executed when an exact error or a class of errors occurs, but it does not provide information about the problem. The reader is expected to be familiar with the stored programs. However, some examples of the use of GET DIAGNOSTICS are useful to demonstrate the contents of the diagnostics area.

First, let's populate the diagnostics area with two errors. For this, we will use the same statements of the previous example:

MariaDB [(none)]> SET sql_mode = 'x';
ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'x'
MariaDB [(none)]> RESIGNAL;
ERROR 1645 (0K000): RESIGNAL...

The error log


The error log contains information about a server's startup and shutdown as well as any critical errors that the server encounters. This includes problems that stop the server or prevent a plugin from starting as well as data corruptions. The log can be enabled or disabled.

Note

The error log is a file and is located in the data directory by default. Its default name is the server's hostname with the .err extension. Using the default name may not be a good idea in a replication environment as all servers have different hostnames, and the administrator may prefer to have identical names for all log files.

On Windows, the error log is enabled by default. If it is explicitly disabled, the errors can be shown on the console using the --console option. Note that this does not work if the --log-error option is present.

Tip

On Linux and Unix systems, the error log is disabled by default. In this case, the errors are written on stderr unless the output is redirected to another file.

On all...

System logs


If mysqld_safe is invoked with the --syslog option, the errors are also logged in the system log (syslog). This feature works only if the system has the logger program, which is usually present on Linux systems, and in such cases, the daemon facility is used. By default, each syslog entry has a mysqld or mysqld_safe tag, depending on the program that generated its entry. If multiple instances of MariaDB (or MySQL) are running on the same system, it is advisable to add a different suffix for each instance to find out which particular instance logged a particular error. To do this, you can start mysqld_safe with the --syslog-tag option, as shown in the following example:

mysqld_safe --syslog --syslog-tag=serv1

In this case, the errors will be logged in the syslog, and the tags will be mysqld-serv1 and mysqld_safe-serv1. However, this option is usually set in the my.cnf file in the server's directory. In this case, the syslog and syslog_tag options must be written in the [mysqld_safe...

The general query log


All statements sent to MariaDB are logged in the general query log or general log. They are written in the same order they were received. This order is never identical to the order of execution on multithread environments (because statements often need to wait for a lock to be released). Connections and disconnections are also written to the general log.

The general log is often suitable for finding problems that are caused by the application's bugs.

The general query log depends on the binary log format. This log will be described in Chapter 8, Backup and Disaster Recovery. While the general log is designed to be read by humans, the binary log is read by programs. A human can read its contents using the mysqlbinlog tool. This tool tracks the changes to databases and does this in different formats such as STATEMENT (SQL statements are logged), ROW (binary data is logged), or MIXED (both methods can be used). The reason for this will be clear in the later chapters, but...

Left arrow icon Right arrow icon

Description

This book is intended for intermediate users who want to learn how to administrate a MariaDB server or a set of servers. It is aimed at MariaDB users, and hence working knowledge of MariaDB is a prerequisite.

What you will learn

  • Identify inefficient queries using logs and log analysis tools
  • Design your indexes and optimize your queries to produce efficient query plans
  • Tune MariaDB and InnoDB configuration to achieve a stabilized degree of performance and reliability
  • Create and manage users, roles, and permissions
  • Perform regular backups and restore data
  • Share your data through several partitions, disks, or servers using techniques such as replication to make operations faster
  • Set up, maintain, and troubleshoot a replication environment as well as a database cluster
Estimated delivery fee Deliver to Colombia

Standard delivery 10 - 13 business days

$19.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 24, 2014
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781783981540
Category :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Colombia

Standard delivery 10 - 13 business days

$19.95

Premium delivery 3 - 6 business days

$40.95
(Includes tracking information)

Product Details

Publication date : Sep 24, 2014
Length: 384 pages
Edition : 1st
Language : English
ISBN-13 : 9781783981540
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $65.97 $94.97 $29.00 saved
MariaDB Cookbook
$54.99
Mastering MariaDB
$54.99
MariaDB High Performance
$48.99
Total $65.97$94.97 $29.00 saved Stars icon
Banner background image

Table of Contents

13 Chapters
1. Understanding the Essentials of MariaDB Chevron down icon Chevron up icon
2. Debugging Chevron down icon Chevron up icon
3. Optimizing Queries Chevron down icon Chevron up icon
4. Transactions and Locks Chevron down icon Chevron up icon
5. Users and Connections Chevron down icon Chevron up icon
6. Caches Chevron down icon Chevron up icon
7. InnoDB Compressed Tables Chevron down icon Chevron up icon
8. Backup and Disaster Recovery Chevron down icon Chevron up icon
9. Replication Chevron down icon Chevron up icon
10. Table Partitioning Chevron down icon Chevron up icon
11. Data Sharding Chevron down icon Chevron up icon
12. MariaDB Galera Cluster Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.8
(10 Ratings)
5 star 20%
4 star 60%
3 star 10%
2 star 0%
1 star 10%
Filter icon Filter
Top Reviews

Filter reviews by




Amazon Customer Jun 23, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is for DB admins. I was hoping it would help me master query tools and or querying more. Instead, it's more about knowing the database tools and what they all do. It is an excellent book if that's what you're looking for. I think for me it was the step after the kind of mastery I was hoping for. From the description, I was thinking this has to just be a high-level outline, but nope, what's in the description is what's in the book; nothing more and nothing less.
Amazon Verified review Amazon
Omega BK Apr 10, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A great book, practical and concise! Mastering is just the right word. Packt Publishing unveiled a good book.This book provides the knowledge needed to administrate the MariaDB server and clusters of servers.It helps to master database development on the MariaDB server,It helps administrators how to maintain a MariaDB server, diagnosing and solving problems encounter on production, such as MariaDB errors, logs, and locks.Performance can be a bottleneck and administrators or Dba will love how this books shows the way to improve the performance of a server by identifying slow queries.I really loved the way the author dealt with set up a proper backup plan and recover data when disaster occurs .The galleria arbitrator was not forgotten, this special type of node designed to help solve the split brain problem.A great book, I really love it and use it on my daily work.What I dislike:the font and indentation of command-line input or output, this font in bold makes reading painful ( really ! )i.e the show processlist output is awful( sorry )despite that, I would recommend this book !thanks a lot.
Amazon Verified review Amazon
Anthony Garratt Sep 02, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I'm not sure you'll 'master' MariaDB with this book but you'll certainly learn plenty. It's a bit of a cookbook style, which makes it very readable.
Amazon Verified review Amazon
Ramon Maria Jan 10, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
First of all, let me say this is not a beginner's book. Some knowledge (deep knowledge I would say for some chapters) is necessary to follow along with the concepts and examples stated in the book.The author, Federico Razzoli, being himself a contributor to the Open Source project MariaDB has a great and very deep knowledge of MariaDB. And that knowledge gets synthesized on this book.This book is heavily focused to administrate a MariaDB server/cluster. So if you are starting with MariaDB or learning SQL in general better look for another, more accessible, book. Personally I would recommend MariaDB cookbook from Daniel Bartholomew and available on packtpub too. The audience for this book is MariaDB administrators who want to understand, leverage and squeeze at its maximum the power MariaDB has to offer.Every chapter has tons of example code (you can download them from the packtpub site) and very useful insight on each and every aspect that is developed.The chapters I've found the most useful for me (I'm not a MariaDB administrator, but I have worked with it) are chapters 1, 2, 3, 5 and 6. They have helped me understand how MariaDB works for the things I usually use the most from it (optimize queries, look for errors, how the cache work, etc...). There are other aspects of the book such as table compression, replication and sharding that are thoroughly explained but I have never used. Anyway, if it comes the time for using them, I know now where to go to use them in an efficient manner.Following I summarize each chapter. What is it about and what can be found in it.Chapter 1 - Understanding the essentialsMariaDB architecture and history. Use of the MariaDB command-line shell. Good point on pagers when making queries on unix-like systems. Information about storage engines available. Information about XtraDB, TokuDB, MyISAM and Aria as different storage engines with the things that makes them unique. There is a section too showing other engines like OOGRAPH (for graph-like data), BLACKHOLE (not sure why it should be used as it does not store anything and always returns an empty set when queried), and other not so usual engines that can be used with MariaDB. Interesting section about logs (what logs do exist and where are they) and caches (with recommendation on size). Thorough explanation about the InnoDB data structure and the authorization and security process on MariaDB. The chapter ends explaining the information_schema database and with a discussion about the compatibility between different versions of MariaDB and MySQL.Chapter 2 - DebuggingThis chapter is about dealing with errors on MariaDB. Deep explanation on different ways to trace an error, from the MariaDB shell console to locating clue information on specific error-logs generated by MariaDB. I like the different sections where the file format for the different logs are explained. This is interesting for me as it eases the process of creating self-made tools to trace down errors. He shows also how to do maintenance for the logs (flushing, rotating, etc...). Different techniques for debugging stored procedures.Chapter 3 - Optimizing queriesHow to activate the slow query log on MariaDB and where this log is located. As in the previous chapter the format file for the log is explained along with tips to interpret the information that is stored within. Use of the slow_log table. Use of the pt-query-digest from the percona toolkit to help track down why a query is slow and how can it be optimized. There is a discussion too about storage engines and indexes. For the indexes only BTREE and HASH are discussed. Others like FULLTEXT and RTREE aren't. Use of EXPLAIN and how to interpret its results and tips on using indexes to optimize queries using joins and subqueries.Chapter 4 - Transactions and locksVery thorough and comprehensive treatment of locks and transactions and how do they work on MariaDB (specifically on InnoDB engine). Tips on tracking down locks and transactions. How to query MariaDB to get info about a lock or a transaction and how to deal with deadlocks when you get one. Special treatment on metadata locks, available on MariaDB since its 5.5 version. Metadata locks make sure the structure of a table will not change while reading or modifying some of its registers.Chapter 5 - Users and connectionsThis chapter goes all the way down from creating a user to give it permissions and the authentication process. It shows you too how to setup MariaDB for using a SSL connection. Adding to that it also shows you how to setup PAM modules to authenticate users and how to configure pools of threads on Unix-like systems and on Windows. A very deep explanation on handling connections (monitoring, killing, etc...).Chapter 6 - CachesA detailed trip over the different caches present on MariaDB. Caches for the different storage engines, how to set them and the different cache pages. Explains the query cache. When to use it and under which circumstances must be avoided (e.g. OQGRAPH storage engine), how to configure it and getting status information. Setting per-session buffers and why a good setting can avoid a DoS over a MariaDB server.Chapter 7 - InnoDB compressed tablesExplains the capacity of the InnoDB storage engine to compress its data. This can be used when the database data grows too much. It also can speed up your queries or not. Anyway this chapter deals with the pros and cons of such technique and when and how to use it and how to monitor it. This chapter ends up with a brief explanation of other compression solutions for the other storage engines.Chapter 8 - Backup and disaster recoveryPreventing data loss the author gives the necessary insight on how to do backups of your data. He explains the different type of backups and how do they differ depending on the storage engine. He also explains which physical files should be stored when doing a full backup, from info files to log files. I found particularly interesting how to create incremental backups using rsync. He talks also about a tool from Percona, XtraBackup, that does not need the server to be stopped and does not lock tables. A word on securing the backups is given. The chapter ends with a thorough discussion on repairing tables.Chapter 9 - ReplicationImproving fault tolerance. Improving query performance using a master-slave architecture. How the binary log is used to make replication possible and how to set it up. How to troubleshoot the most common problems.Chapter 10 - Table partitioningIn this chapter the author explains how to deal with very large tables splitting them up to be easier to read and write on them. Which storage engines can be used and how to maintain those partitions.Chapter 11 - Data shardingThe author discusses the three main methods MariaDB makes available to distribute data among servers: balancing I/O, the FEDERATEDX storage engine and the SPIDER storage engine, which I personally have found very interesting.Chapter 12 - MariaDB Galera clusterThis chapter explains how to create a cluster of MariaDB servers using Galera. It starts presenting key Galera concepts and why it fits perfectly for cloud computing. Following that there is a tutorial-like section explaining how to install and configure Galera and how to create a cluster along with its limitations (avoid query cache or using XA transactions). Monitoring tools and tips are given to control the clusters with examples of scripts. Finally the Galera Load Balancer is presented to distribute the workload among the nodes forming the cluster.Disclaimer: I was given an ebook copy from the publishers in order to review it.
Amazon Verified review Amazon
ernestina menasalvas Jan 07, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Mastering Maria DB is a book for learning how to administrate the MariaDB server.It is intended for users that are quite familiar with MySQL. Newcomers to MariaBD even if they are familiar with other relational database servers administrative task will find it hard to follow.It is not a theoretical book it is a hands-on book so read it together with your instance of MariaBD server runnig close to you to take advantage of it.The main features an admisnistrator of MariaBD would know are covered in the book. However being a master administrator it could happen that sometimes some of the problems tackled you will feel you would like them to be covered more roughly and deeper
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela