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 :
Just another how-to blog
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 :
In PHP, str_replace will replace all the occurrence key in a string to the value that specified by user.
In Javascript, if you using a replace function without specified, it will only replace the first occurrence of the key in the string to the value.
For example :
<script>
var js_str = "Visit RedHat now & RedHat will give out free gift to you";
js_str.replace("RedHat","how2guru");
alert(js_str);
</script>
The output of the above script will give you :
Visit how2guru now & RedHat will give out free gift to you
If you would like to replace all the occurrence key to the value, you have to use the global match. It will replace all the occurrence key.
read more »
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)
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:
Previously I had work on the telnet to some mail server & trying to send out the email (refer here).
Recently I am working on some with the mail server again, but is receiving this time.
I am using PHP + MySQL to access to a mail account & try to clean up the email account due to it contain 100k+ emails (1.7G) inside the inbox. This is a headache problem & I cant even login the mail account by webmail. That’s why I decided to write an backend script to delete “SPAM” emails.