MySQL

MySQL

My current MySQL conf file my.cnf

Posted April 14th, 2012 by admin


[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
max_allowed_packet = 100M
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking


skip-bdb


set-variable = innodb_buffer_pool_size=1G
set-variable = innodb_additional_mem_pool_size=20M
set-variable = innodb_log_file_size=250M
set-variable = innodb_log_buffer_size=8M
set-variable = innodb_thread_concurrency=4
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


skip-bdb


set-variable = innodb_buffer_pool_size=1G
set-variable = innodb_additional_mem_pool_size=20M
set-variable = innodb_log_file_size=250M
set-variable = innodb_log_buffer_size=8M
set-variable = innodb_thread_concurrency=4

Backup and restore MySQL db

Posted April 14th, 2012 by admin

Problem
There are unrecovery problems in Ibdata log files

Solution
# login to mysql:

> mysql -u admin -p


mysql> show databases;

# per each db dump all data


> mysqldump -u admin -p database | gzip -9 > database.sql.gz

# Now Ibdata log files can be deleted


> service mysqld restart

# Restore all dbs from dump files


gunzip < database.sql.gz | mysql -u admin -p database

# Retype password for DB users.

user warning: Can't create/write to file '#sql_362c_0.MYD' (Errcode: 17)

Posted April 14th, 2012 by admin

Error:
user warning: Can't create/write to file '#sql_362c_0.MYD' (Errcode: 17)

Solution:
Remove file named #sql_362c_0.MYD from temporary directory that is used by mysql, in our case it is - /var/lib/mysql/

In case error has not disappeared - clear Drupal page cache

When run database_dump.sh - error Got a packet bigger than 'max_allowed_packet' bytes

Posted April 7th, 2012 by admin

Add to /etc/my.cnf

[mysqld]


max_allowed_packet = 100M

Error with collation

Posted April 6th, 2012 by admin

If you get such error:

user warning: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' query: SELECT qid FROM top_searches WHERE q = 'орп' in .\includes\database.mysql.inc on line 172.

Change all collation for the db, each table, each row of the table from latin1_swedish_ci collation to utf8_general_ci

Syndicate content