RSS
people

Export mysql select statement into csv

Today I would like to share some useful command for developer to export out data by using SQL statement.
I think most of the developer should familiar with the putty & command line environment.
But always facing an problem to export out the data in a excel/csv file in order to send it to customer.

Here is a simple but useful MySQL command to export out your data in a csv file.
read more »

No Comments | Tags: , ,

MySQL release free disk space.

When perform some data clean up in MySQL, found that no disk space was release and MySQL still occupied it.

Here is the command to check those tables with more than 300MB of data:
read more »

No Comments | Tags:

Check MySQL database size

How to check MySQL database size in your server? 
Actually MySQL already provide the information, what you need to do is just do a simple query to retrieve the data.

Below is the query :

read more »

3 Comments | Tags: ,

MySQL table corrupt & repair

Recently I am trying to dump a customer MySQL database to a SQL file & restore to another server.
An error occur during the dump process.

The error mention that one of the table in the database is crashed & repair required.
Then I try to login into MySQL server & use the particular database & execute the “DESC” command.
The result is “ERROR 145 (HY000): Table ‘./XXXXXXX/tracker’ is marked as crashed and should be repaired”

mysql> desc tracker;
ERROR 145 (HY000): Table './XXXXXXX/tracker' is marked as crashed and should be repaired
mysql> check table tracker;
+----------------------+-------+----------+----------------------------------------------------------------------------+
| Table                | Op    | Msg_type | Msg_text                                                                   |
+----------------------+-------+----------+----------------------------------------------------------------------------+
| XXXXXXX.tracker      | check | error    | Table './XXXXXXXXX/tracker' is marked as crashed and should be repaired |
+----------------------+-------+----------+----------------------------------------------------------------------------+
1 row in set (0.03 sec)

read more »

4 Comments | Tags:

Apache PHP unable connect remote MySQL

Recently I am setup a new server for one of my company client.
After finish configure the server & I am trying to setup SugarCRM inside the server, I found that the database connection part is not able to connect to a remote database server.
Then I try to fill in database information to local database server & everything is working fine.

Then I googled a while & found that it is a SELinux issue. It seem like block apache connect to a remote database server.

Below is my solutions:

read more »

No Comments | Tags: , , ,