Wanted the ISO 3166 country codes in my database to use in an application. Downloaded the semi colon seperated country codes file from: http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm Then created a database and a table to hold the data: create table country_codes ( id int not null auto_increment, code varchar(2) not null, country varchar(254) not null, primary key (id)); [...]
Entries Tagged as 'MySQL'
Importing country ISO 3166 codes into MySQL database
September 4th, 2010 · 1 Comment
MySQL tuning script
March 4th, 2010 · No Comments
This looks like a useful mysql tuning script: http://blog.mysqltuner.com/ Otherwise the mysql.com pages are good for tuning: http://dev.mysql.com/doc/refman/5.0/en/optimization.html http://dev.mysql.com/doc/refman/5.1/en/optimization.html
Magento database error
March 1st, 2010 · No Comments
Had a problem with Magento stores not loading and the following errors were being presented when going to the site. Error: SQLSTATE[HY000]: General error: 145 Table ‘./magento/log_visitor_info’ is marked as crashed and should be repaired Trace: #0 /var/www/vhosts/magento/httpdocs/lib/Zend/Db/Statement.php(283): Zend_Db_Statement_Pdo->_execute(Array) #1 /var/www/vhosts/magento/httpdocs/lib/Zend/Db/Adapter/Abstract.php(457): Zend_Db_Statement->execute(Array) #2 /var/www/vhosts/magento/httpdocs/lib/Zend/Db/Adapter/Pdo/Abstract.php(230): Zend_Db_Adapter_Abstract->query(‘INSERT INTO `lo…’, Array) #3 /var/www/vhosts/magento/httpdocs/lib/Varien/Db/Adapter/Pdo/Mysql.php(281): Zend_Db_Adapter_Pdo_Abstract->query(‘INSERT INTO `lo…’, Array) #4 [...]
Tags: Linux · MySQL · Operating System
MySQL replace() function
January 8th, 2009 · 1 Comment
URL: http://www.nikmakris.com/2005/mar/29.html http://www.xaprb.com/blog/2006/04/14/bad-character-data-in-mysql/ – “How to find and fix invalid character data in MySQL” update [table_name] set [field_name] = replace([field_name],’[string_to_find]‘,’[string_to_replace]‘);
Tags: MySQL