Flush tables in MySQL

Moderator: cah

Post Reply
cah
General of the Army / Fleet Admiral / General of the Air Force
General of the Army / Fleet Admiral / General of the Air Force
Posts: 1342
Joined: Sun Aug 17, 2008 5:05 am

Flush tables in MySQL

Post by cah »

I was setting up Chia-Wei's web site along with his first birthday party invitation application.

I tested it last week on July 3rd and all worked.
I sent out invitation today to family and friends.
I got an email from Richard saying he can't come because he's in China.
However, I didn't see entry in the database table. From error log, it looks like the single quote (') was causing perl to hiccup. I substitute ' with \' and it seemed to work.

However, after some cleaning up of the table, it showed my Error 1194 saying the table has crashed and asked me to flush tables.

Here is the steps I found to fix it:

Code: Select all

$ /usr/local/bin/mysql -u mysql -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.1.40-log Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use Chia-Wei
Database changed
mysql> flush tables;
Query OK, 0 rows affected (0.00 sec)

Then, I was able to view the table again.

Strangely, I was not having such issue before. All I did was to delete a row from the table and change the index number in the table. It was working find all the time until today. Could it be because I created a symbolic link of Chia-Wei in /usr/local/var?
CAH, The Great
Post Reply