Tagged: mysql RSS

  • Nathan Haskins 10:34 am on September 30, 2010 Permalink | Reply
    Tags: , mysql,   

    php parse csv files into mysql commands 

    A quick script to take a .csv file, and generate some insert commands into mysql. The client hands me a spread sheet file, i drop it into a folder and run the script pretty easy.

    add one csv file, and run.

     
  • Nathan Haskins 7:53 am on June 17, 2010 Permalink | Reply
    Tags: mamp, mysql   

    MAMP setup after changing mySQL default password 

    After changing the default password for mySQL, MAMP throws connection errors on restarting, here’s the links to go correct:

    Correct path:
    (from terminal) /Applications/MAMP/Library/bin/mysqladmin -u root -p password NEWPASSWORD
    /Applications/MAMP/bin/mamp/index.php
    /Applications/MAMP/bin/phpMyAdmin/config.inc.php
    /Applications/MAMP/bin/stopMysql.sh

    Helpful thread that gets into more detail:

    http://forum.mamp.info/viewtopic.php?f=2&t=1719

     
  • Nathan Haskins 6:46 pm on May 2, 2010 Permalink | Reply
    Tags: , mysql, ,   

    Localizing wordpress, and some handy mySQL to speed it up 

    Localizing wordpress after moving it from one domain name to another? It use to be a pain in the ass to hunt down all the link.. well it still can be. However, these mySQL find and replace commands speed it up a heck of a lot. If your theme is pretty basic, you may be done after running these.

    In the commands below, Im going from my old dev address ‘studio2108.com.s52733.gridserver.com’ to my new address ‘studio2108.simplehelix.com’. Remember to back up your database before trying this.. anyway take the 4 lines below, cut them, edit them, and then paste them into phpmyadmin’s SQL tab and your good.

    Whats weird is the theme file has hardcoded references to studio2108.com in the header file… im finding and replacing them for now.

    update wp_posts set guid = replace(guid,'com.s52733.gridserver.com', 'simplehelix.com');
    update wp_posts set post_content = replace(post_content,'com.s52733.gridserver.com', 'simplehelix.com');
    update wp_options set option_value = replace(option_value,'com.s52733.gridserver.com', 'simplehelix.com');
    update wp_postmeta set meta_value = replace(meta_value, 'com.s52733.gridserver.com', 'simplehelix.com');