mysql

[SOLVED] MySQL Error 1016: Can't open file: 'user_tracking.MYD'. (errno: 145)

Jul
02

We've been running osCommerce website flawlessly for over two years, but recently encountered the following MySQL error.

1016: Can't open file: 'user_tracking.MYD'. (errno: 145)

We're running mysql 3.23.58 version, and recently restarted the mysqld by killing the mysql processes. This may have corrupted the table file named above.

You may use phpMyAdmin to "repair" the corrupted table. Or, use the command line from the mysql client.

Posted By admin read more

[SOLVED] mysqldump: Can't get CREATE TABLE for table

Jul
02

Have you tried to make a backup of a MySQL database, and run into a problem with errors?

Posted By admin read more

[SOLVED] Zen Cart incorrect time zone

Jun
24

Our Zen Cart installation has incorrect time zone. On the orders page, the orders are placed +5 hours from current date/time. This is very annoying problem as the server is showing correct time, and PHP is configured with correct time zone in /etc/php.ini file. Also, the correct time zone is set in the includes/application_top.php file.

Posted By admin read more

[SOLVED] ERROR 1206 (HY000): The total number of locks exceeds the lock table size

May
23

We have a customized Openbravo POS v2.2 running with a dozen workstations operating 24x7 a year around. The size of the database has grown to 10GB, and the performance started to degrade so we decided to archive old data and start fresh. According to Openbravo POS administrative guide, we performed a DELETE operation on transaction data.

Posted By admin read more

[SOLVED] MySQL Crash with Fatal error: cannot allocate memory for the buffer pool

May
23

We have a dozen websites mostly running Wordpress, and one Drupal website on Digital Ocean with a 1GB instance. The server was running flawlessly for 6 months, and then the MySQL starts to crash every few days unexpectly with the following error in the mysql error log.

Posted By admin read more

MySQL Character Set and Collation

Jun
29

MySQL documentation states the following in respect to "character set" and "collation" of the data storage in the database.

Posted By admin read more

How to change MySQL user and root password?

Jun
09

We have been using DirectAdmin control panel for a number of years, and each time we setup a server it is necessary to change the root password. By default, Direct Admin creates a MySql superuser called "da_admin" with a preassigned password, but we do not know what the root password is. Since we use both DirectAdmin and command-line to manage our server, it is essential that we have proper MySQL root password assigned.

Posted By admin read more

How to change primary key values

May
06

To change values of existing integer field (`table` is the table name, and "id" is the column name), you may use the following update SQL command:

update `table` set id=id+10000;

Let's say that you have an ecommerce website, and you want your order number to begin 10001. But, you already have a handful of orders already so you'll just update the existing values.

If you're updating your primary key values, MySQL will automatically adjust auto_increment value to begin after the largest number stored in the database.

Posted By admin read more

How to reverse a MySQL result set?

Feb
04

I need to grab last 100 rows of a MySQL table, and loop them through in reverse order. The array_reverse() PHP function won't reverse the "resource" or "array" data types, so it isn't as easy to reverse the array of "mixed" data type. The best way to achieve this is by using a SQL statement as shown below.

SELECT * FROM (SELECT * FROM mytable ORDER BY id DESC limit 100) 
AS foo ORDER BY id ASC;

You may also retrieve the MySQL result set in descending order, and traverse the set in reverse order.

Posted By admin read more
Subscribe to RSS - mysql