Monthly Archives: February 2016


mysqldump: Got error: 1044: Access denied for user ‘username’@’ip’ to database ‘db’ when doing LOCK TABLES

When trying to issue the command

mysqldump -h "mysql.example.com" -u "username" -p"password" db table_A table_B

to get the MySQL dump for two tables (table_A and table_B), you will get the error

mysqldump: Got error: 1044: Access denied for user 'username'@'ip' to database 'db' when doing LOCK TABLES

when your account does not have the ‘LOCK TABLES’ right.

The ‘LOCK TABLES’ right gives you access to the command LOCK that can be used to emulate transactions or to get more speed when updating tables by preventing other sessions from modifying the locked tables.

To mitigate the problem, use the --single-transaction option as follows

mysqldump -h "mysql.example.com" -u "username" -p"password" --single-transaction db table_A table_B

 

Documentation:

·   --single-transaction

This option sets the transaction isolation mode to REPEATABLE READ and sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications.

When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. For example, any MyISAM or MEMORY tables dumped while using this option may still change state.

While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents and binary log coordinates), no other connection should use the following statements: ALTER TABLE, CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE. A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the SELECT that is performed by mysqldump to retrieve the table contents to obtain incorrect contents or fail.

The --single-transaction option and the --lock-tables option are mutually exclusive because LOCK TABLES causes any pending transactions to be committed implicitly.

This option is not supported for MySQL Cluster tables; the results cannot be guaranteed to be consistent due to the fact that the NDBCLUSTER storage engine supports only the READ_COMMITTED transaction isolation level. You should always use NDB backup and restore instead.

To dump large tables, combine the --single-transaction option with the --quick option.

 

 


2GB επιπλέον χώρος στο GMail

Για να πάρετε δωρεάν 2GB επιπλέον χώρο μπείτε στον έλεγχο ασφαλείας του profile σας μέχρι τις 11 Φεβρουαρίου 2016 (αύριο) και ολοκληρώστε την διαδικασία.

Διαρκεί μόνο 2 λεπτά και 2GB επιπλέον χώρος θα γίνουν δικά σας!

Αυτή η κίνηση έγινε επ’ευκαιρίας της ημέρας ασφαλής χρήσης του διαδικτύου.


Ημερίδα Πληροφορικής 2016

Impress/ PowerPoint format Download: [download id=”1337″]

PDF format Download: [download id=”1341″]

7η Ημερίδα Πληροφορικής για μαθητές/τριες Λυκείων και Τεχνικών Σχολών

Ο βασικός στόχος της Ημερίδας Πληροφορικής είναι να ενημερώσει, να διαφωτίσει, αλλά κυρίως να ενθαρρύνει τους νέους μας να ανακαλύψουν τις ευκαιρίες εκπαίδευσης στην Επιστήμη της Πληροφορικής καθώς και να πληροφορηθούν για τις επαγγελματικές προοπτικές που προσφέρει η επιστήμη αυτή. Η ημερίδα στοχεύει κυρίως στους μαθητές της Α’ τάξης Λυκείων και Τεχνικών Σχολών, οι οποίοι βρίσκονται στο κρίσιμο στάδιο της
επιλογής των επόμενων μεταλυκειακών βημάτων τους. Η ημερίδα ευελπιστεί ότι θα βοηθήσει τους συμμετέχοντες να αποκτήσουν μια καλύτερη άποψη για την Επιστήμη της Πληροφορικής. Την προσπάθειά μας αυτή ενισχύει το Υπουργείο Παιδείας και Πολιτισμού καθώς και ο Κυπριακός Σύνδεσμος Πληροφορικής (Cyprus Computer Society – CCS).

hmerida060216

Impress/ PowerPoint format Download: [download id=”1337″]

PDF format Download: [download id=”1341″]

 


[GitLab.com] Clone all repositories in your account 1

GitLab.com offers a public API that allows us to get information related to our accounts. One of the API calls available is the account projects call (http://gitlab.com/api/v3/projects).

This call will return a JSON object describing the projects available to your account.

To clone all of the projects available to you, you can use the following:

TOKEN="PASTE_YOUR_PRIVATE_TOKEN_HERE"; PREFIX="ssh_url_to_repo"; curl --header "PRIVATE-TOKEN: $TOKEN" http://gitlab.com/api/v3/projects | grep -o "\"$PREFIX\":[^ ,]\+" | awk -F ':' '{printf "ssh://"; for (i=2; i<NF; i++) printf $i "/"; print $NF}' | xargs -L1 git clone

The above code will bring the JSON object, filter out everything except for the “ssh_url_to_repo” member of each project and then it will use it to clone the project by fixing up the URL to be used by git.

To get the above code working: the GitLab API requires that you use a token that is related to your account instead of using your credentials to make the call to the API.

To get your private token, visit this page http://gitlab.com/profile/account , the private token is the random sequence of characters in the white box:

[GitLab.com] Private TokenYou need to copy that value in the place of the variable TOKEN in the above script.

In case you have a lot of projects (more than 10), the default call will only produce the results for the first 10 repositories only.

To list all available repositories you have two options:

  1.  Set the per_page query parameter to a value big enough to fetch all your projects information if they are less than 100. e.g http://gitlab.com/api/v3/projects?per_page=100
  2. Follow the link headers from the initial response to make all the next calls.