Ярлыки

Показаны сообщения с ярлыком MySQL. Показать все сообщения
Показаны сообщения с ярлыком MySQL. Показать все сообщения

воскресенье, 6 апреля 2014 г.

MySql compressed row format ("Row size too large" error resolve)

I have follow error:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 222, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
    output = self.handle(*args, **options)
  File "/home/vinger4/Projects/a360/router/management/commands/places_update.py", line 428, in handle
    airport.save()
  File "/home/vinger4/Projects/a360/content/models.py", line 545, in save
    super(Airport, self).save(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 546, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/base.py", line 626, in save_base
    rows = manager.using(using).filter(pk=pk_val)._update(values)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", line 605, in _update
    return query.get_compiler(self.db).execute_sql(None)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 1020, in execute_sql
    cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/sql/compiler.py", line 846, in execute_sql
    cursor.execute(sql, params)
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 128, in execute
    six.reraise(utils.DatabaseError, utils.DatabaseError(*tuple(e.args)), sys.exc_info()[2])
  File "/usr/local/lib/python2.7/dist-packages/django/db/backends/mysql/base.py", line 120, in execute
    return self.cursor.execute(query, args)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
DatabaseError: (1118, 'Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.')

Set ROW_FORMAT=COMPRESSED for my_table:

mysql> SET GLOBAL innodb_file_format=Barracuda; SET GLOBAL innodb_file_per_table=ON; ALTER TABLE my_table ROW_FORMAT=COMPRESSED;
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 258 rows affected (0.35 sec)
Records: 258  Duplicates: 0  Warnings: 0

mysql> 

суббота, 3 ноября 2012 г.

problem with easy_install mysql-python


http://stackoverflow.com/questions/1511661/virtualenv-mysql-python-pip-anyone-know-how

You can install "libmysqlclient-dev" from ubuntu software center

mysqldump: dump by table


dump for one table:
mysqldump -u user -p password databasename table1 > ~/dumpfile.sql

dump for few tables (table1, table2, table3):
mysqldump -u user -p password databasename table1 table2 table3 > ~/dumpfile.sql

mysql: current table encoding



SELECT CCSA.character_set_name FROM information_schema.`TABLES` T,

       information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA

WHERE CCSA.collation_name = T.table_collation

  AND T.table_schema = "schemaname"

  AND T.table_name = "tablename";

mysql: Got a packet bigger than 'max_allowed_packet' bytes


Mysql get follow message on the import dump: "Got a packet bigger than 'max_allowed_packet' bytes"

Run mysql in the other bash, writing: "set max_allowed_packet=100M"

May be, this parameter also can help: net_buffer_length=1000000

вторник, 5 июня 2012 г.

mysql: Got a packet bigger than 'max_allowed_packet' bytes


Mysql выдаёт сообщение при попытке залить дамп: "Got a packet bigger than 'max_allowed_packet' bytes"

Открываем mysql ещё в одной консоли, пишем:set max_allowed_packet=100M
Далее повторяем попытку импорта дампа - работает!

Возможно, ещё пригодится параметр: net_buffer_length=1000000