Articles tagged with mysql

  1. Magento Home Page Returns 404 Status Code

    Posted on in System Administration

    Naturally, I ran into this problem in the middle of the night when the client was asleep and I had no access to the Magento administrative interface. The short story is that after running a re-index of the site, the home page began returning a 404 error status. A bit …

  2. [MySQL] Stuck at copying to tmp table

    Posted on in System Administration

    I have a fairly lightly loaded MySQL server with a few tables that are updated every five minutes. Other than these updates, there are very few queries run against the database. The data is queried just a few times per month. Ever so often, one of the more complicated queries …

  3. SNMP Traps into MySQL is Sublime

    Posted on in System Administration

    I use snmptrapd to catch SNMP traps and then put them into a MySQL database using a pretty generic trap handler. This gives me the opportunity to generate such useful information as:

    > SELECT HOUR(time) AS "hour", COUNT(*) AS "bounces" FROM snmptraps
        WHERE hostname = 'XXX' AND time > '2011-07-25'
            AND trap_oid …
  4. MySQL: Disable DNS Lookups

    Posted on in Software

    Powered By MySQLIn a small environment, there's very little reason to rely on DNS resolution inside MySQL. You can disable it by adding skip-name-resolve to your my.cnf or by using the --skip-name-resolve command line argument.

    Remember that if you disable DNS lookups, you will need to set permissions using IP addresses …

  5. MySQL Multiple-Column Indexes: Order Matters

    Posted on in Programming

    Powered By MySQLThis will just be a short reminder. If you're planning to create multiple-column indexes in MySQL, remember that the order of the columns matters. As the MySQL documentation points out, any "leftmost prefix of the index can be used." This means that the index can be used for any number …

  6. MySQL + SELinux: Can't change dir (Errcode: 13)

    Posted on in System Administration

    Powered By MySQLIf you're using a non-standard MySQL data directory on your Red Hat Enterprise Linux (RHEL) server, you may have seen an error like /usr/libexec/mysqld: Can't change dir to '/mysql_data/' (Errcode: 13). The key to fixing this problem is to ensure the new MySQL data directory has the proper …

  7. Cisco Access Registrar ODBC Remote Server KeepAliveTimerInterval

    Posted on in Software

    In a test lab, we ran into a situation where the connection between our Cisco Access Registrar (AAA) server and MySQL server was timing out. This forced the server to reconnect and resulted in the following errors:

     name/radius/1 Error Server 0 ODBC client (DataSource 'my_odbc', Connection 8): SQLExecute …
  8. MySQL: Query caused different errors on master and slave

    Posted on in System Administration

    We ran across the following error on a MySQL slave server recent:

    mysql> SHOW SLAVE STATUS \G
    <snip>
    Last_Error: Query caused different errors on master and slave. Error on master: 'Deadlock found when trying to get lock; try restarting transaction' (1213), Error on slave: 'no error' (0). Default database: '<database_name …
  9. Two Random Asterisk-Related SQL Queries

    Posted on in voice

    I hate losing useful SQL queries, so I tend to save them. Ever so often, I stumble across a file of queries from some work I was doing months ago. The following two queries are just such a case. I was analyzing some call data for a call center that …

  10. Enabling Vertical (\G) Output in the MySQL Client

    Posted on in Software

    g (photo by donsimon)One problem with the MySQL command line client is that queries with lots of columns tend to wrap crazily based on your terminal size. To overcome this, you can get a vertical output by terminating your queries with \G instead of ;. I find this format extremely helpful in cases where …

  11. MySQL Gotcha: Remote Root Access

    Posted on in software

    By default, MySQL only allows access by the 'root' account from the host running the database server ('localhost'). Often times that's perfectly adequate. There are occasions when you need remote access as the 'root' account, however. In these cases, it's helpful to be aware of one little gotcha when creating …

  12. The Unjoy of Hanging MySQL Locks

    Posted on in Software

    Currently, I use mysqldump to backup several large MySQL databases amounting to millions of rows of data. During the dump process, tables get locked for reading. 99% of the time, this system works just fine.

    Ever so often (perhaps every 50-100 dumps), a read lock will hang on a table …

  13. Hey Slap: How Do I Define My Own MySQL Prompt?

    Posted on in Software

    Someone looked over my shoulder the other day and was blown away by my MySQL client prompt.

    (slap@localhost) [slaptijack]>
    

    The boring default client just acknowledges that you are using MySQL and nothing more. This prompt indicates your username, the server you are working on, and the database you are …

Slaptijack's Koding Kraken