Category Archives: Uncategorized

Another MySQL Error. ERROR 2006 (HY000) at line []: MySQL server has gone away

When I tried to import fairly large SQL file, I got this error. File was too large to be imported.

This was because ‘max_allowed_packet’ variable had fairly small value. Mine was ‘4194304’ which is 4MB.

I set it to 64 and same import went smoothly.

Let’s look at variables in MySQL: SHOW VARIABLES LIKE ‘max%’. This will bring a large list of variables.

SHOW VARIABLES LIKE 'max%';
+----------------------------+----------------------+
| Variable_name              | Value                |
+----------------------------+----------------------+
| max_allowed_packet         | 4194304              |
| max_binlog_cache_size      | 18446744073709547520 |
| max_binlog_size            | 1073741824           |
| max_binlog_stmt_cache_size | 18446744073709547520 |
| max_connect_errors         | 100                  |
| max_connections            | 151                  |
| max_delayed_threads        | 20                   |
| max_digest_length          | 1024                 |
| max_error_count            | 64                   |
| max_execution_time         | 0                    |
| max_heap_table_size        | 16777216             |
| max_insert_delayed_threads | 20                   |
| max_join_size              | 18446744073709551615 |
| max_length_for_sort_data   | 1024                 |
| max_points_in_geometry     | 65536                |
| max_prepared_stmt_count    | 16382                |
| max_relay_log_size         | 0                    |
| max_seeks_for_key          | 18446744073709551615 |
| max_sort_length            | 1024                 |
| max_sp_recursion_depth     | 0                    |
| max_tmp_tables             | 32                   |
| max_user_connections       | 0                    |
| max_write_lock_count       | 18446744073709551615 |
+----------------------------+----------------------+
23 rows in set (0,00 sec)

Let’s set ‘max_allowed_packet’ to 64MB (it’s 67108864 bytes): ‘SET GLOBAL max_allowed_packet = 67108864′.

Since we know what we are looking for, let’s query: ‘SHOW VARIABLES LIKE ‘max_allowed_packet’ or ‘SHOW VARIABLES WHERE variable_name = ‘max_allowed_packet”.

SHOW VARIABLES LIKE 'max_allowed_packet';
+--------------------+----------+
| Variable_name      | Value    |
+--------------------+----------+
| max_allowed_packet | 67108864 |
+--------------------+----------+
1 row in set (0,01 sec)

MySQL. ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Since installing fresh MySQL on my MacBook I tried to create a new database user and a new database couple of times. On local I usually use rather weak passwords, but when I was trying to set a weak password, I was getting an error: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements.

I googled this error some time ago and somehow I was OK with the results I’ve found:

  • password has to be 8 symbols long,
  • password should have at least one special symbol and one number.

Apparently that happens because of a plugin called validate_password.

You can view validate_password properties: SHOW VARIABLES LIKE ‘validate_password%’.

+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0,02 sec)

From the table above we see that ‘validate_password_policy’ is set to ‘MEDIUM’ (1). Other possible values are ‘LOW’ (0) or ‘STRONG’ (2).

We can set it to ‘LOW': SET GLOBAL validate_password_policy = ‘LOW’.

‘validate_password_length’ = 8. This sets password length. It can’t be less than 2 × validate_password_mixed_case_count + validate_password_number_count + validate_password_special_char_count. Let’s leave it 8.

‘validate_password_mixed_case_count’ = 1 means that password should have at least one UPPERCASE and one lowercase letter. This property only works if ‘validate_password_policy’ variable is ‘MEDIUM’ or ‘STRONG’.

‘validate_password_number_count’ = 1. This is the minimum number of numeric (digit) characters. This works if password policy is ‘MEDIUM’ or stronger.

‘validate_password_special_char_count’ = 1. This is minimum number of nonalphanumeric characters. This works if password policy is ‘MEDIUM’ or stronger.

After setting ‘validate_password_policy’ to ‘LOW’ I was able to create weak passwords on my local MySQL.

New Year’s Resolution

OK, it’s almost 2016.

I didn’t ask for any presents, so I probably won’t get anything. But that’s OK. Instead of this, I want to give myself a present — successful and productive 2016.

My New Year’s resolutions will be:

  • Go to the gym once in two days. Even small visits count. A big one for the weekend.
  • Lose 15 kilos.
  • Prepare for 5k in summer.
  • Read a book every 3 weeks.
  • Make work progress every day.
  • Launch a project by end of January.
  • Post a blog every week.

That’s it.

Responsive Design (My First Attempt)

Well, I started to do responsive design. This is not hard at all. Being all mathematical in the past percentages is really easy for me. The thing I don’t understand is people using really shitty values at first.

Why <div class="content"> has to be 31.67777875%? It’s a baseline-ish measure…. Just go for something like 31.25%. This means just couple of pixels difference, but as this is one of the core values your grid will rely on, you don’t need to overcomplicate.

PS. Found this RQRWD site. Very straightforward, beautifully made, but maybe too simple as opposed to Gridset which is overcomplicated for most of the tasks.

Should probably try and make something inbetween.

Breaking Bad

Breaking Bad screen

Was fun at first… But too much violence I guess. Definitely not for me.
It was alright when they first started cooking, was even better when Jesse was off drugs. Was kinda nice when they started working with Gus, with all this new equipment, great lab, pile of money.

Was again very interesting when Hank started to look into that again.

But rather hard to watch after Todd killed a kid on a dirtbike, sad when they shot Hank once, even more sad when they killed Hank.

And too much drama, especially everything that had to do with Holly being kidnapped, being driven away by her mother. Just too much for a little baby to take. (This is probably father talking inside me)

Weeds is much more fun.

Things to do list

I don’t like term Bucket list, y probably can guess why. Term wishlist doesn’t really fit too. So I would like to write about some things I would love to do in the near future, let’s say next 10 years.

Firstly, I want to see Depeche Mode live. I always wanted to, but I remembered that now because I am watching their Tour of the Universe in Barcelona and it’s touching and inspiring. Knowing that there will be shows in Moscow and Saint-Petersburg next year, I desperately want to be there. Especially because I like their 13th album Delta Machine.

Secondly. I want to go to Formula 1 Gran Prix. Monaco preferrably, but I would say that any Gran Prix will do. I guess I’ll will write a separate post on my favourite tracks, but for now any will do. Would be even better to have a ticket with pitlane and paddock access.

Thirdly. That’s probably the first one I am going to actually achieve. I want to have a supercar day. I would even say, next time I am in Britain, I will have a supercar day. I’ve seen tons of Groupon deals when you can take a supercar for 5 laps for 100 quid or so. Ferrari would be my choice if I have one.

Fourthly. I want to drive an F1 car. I once saw on TV that there is some sort of school in France that lets you drive an F1 car after you’ve done 2-days of training. Back then — it was about 10 years ago — it cost couple thousand euros.

Don’t want to count anymore…

— I want to shoot timelapse video while driving from St. Petersburg to Kazan, multiple angles of course. So I need couple GoPro HERO cameras to mount outside and couple of iPhones that will work like interval camera from inside of the car. I would obviously need to go to Saint Petersburg with my friend Dmitry.

— I want to drive through United States. I will have a route with POIs shortly. But that will be a months journey at least.

— I want to drive up the very very high mountain. 17,200 ft in Andes as Top Gear did is just perfect.

— Well, speaking of Top Gear, I am a big fan of the show. I want to get in, even if I need to fly to UK for that.

— I want to spend a night in some scyscraper hotel. I am thinking 80th floor or higher.

Sounds achievable I would say.

Top Gear

I recently started to watch TopGear again. Right from the beginning, series 1. I think it’s the best car program in the world. The format, the presenters, the music, the video—no one can do better. Somehow they manage to make the show exciting.

Series 1:

  • Jeremy goes to Calle in Citroen Belingo
  • Richard shows concept of Ford GT40
  • Jeremy Drives Pagani Zonda (CI2 SRH) agaings Lamborghini Murcielago (YI)
  • Richard tests what speed you need to be doing to avoid speed cameras:
    Honda Civic Type R 129mph — not enough
    Mercedes CL AMG 148mph — not enough
    TVR Tuscan S (S6 TVR) over 170 mph
  • Jeremy starts Volvo 740 diesel that runs on vegetable oil
  • Richard drives Mazda 6 (GL02 NBG) sport saloon

News

  • Mentioned Bentley Continental GT

Power Laps

  • Lamborghini Murcielago: 1:29
  • Pagani Zonda: 1:23

Star in a reasonably priced car

In Series 1 they drive Suzuki Liana as a reasonably priced car. It costs just 9995 pounds.

Discographies in iTunes Store

Recently, when iTunes Music Store came to Russia, I began to use it for purchasing music. Pretty much everything Apple does is excellent and user-friendly. And iTunes Store is not an exception. Searching music is easy, discovering new music is easy, buying music is also easy… But in small quantities. Thing I really miss is discographies.

I am a big fan of Depeche Mode. I have some of their albums ripped from CDs, I have their recent album Delta Machine purchased from iTunes Store. But being big fan is about having everything. I want to buy every album they officially released, I want to buy every single. I don’t need tributes, I don’t need unofficial remixes, I don’t need their songs from soundtracks, I don’t need mash-ups. All this I can buy if I want to. But I really need a shortcut to buy a discography.

I think it’s not just me who thinks there should be such a feature in iTunes Store. You can buy a complete album (not song by song). It is even cheaper to buy it that way. What’s wrong with discographies?

Depeche Mode in iTunes Store
Depeche Mode in iTunes Store
Depeche Mode Albums in iTunes Store
Depeche Mode Albums and Singles in iTunes Store. You can buy all of them if you want to. Takes a lot of time though…

Please, Apple, please…