Copy existing table schema to a new table
Answer:
To copy the table schema of an existing table to a new table, without copying its data:
mysql> CREATE TABLE new_table LIKE old_table;
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Copy existing table schema to a new table
Answer:
To copy the table schema of an existing table to a new table, without copying its data:
mysql> CREATE TABLE new_table LIKE old_table;
Send the crontab result to email
Answer:
To send the crontab's result to email, follow the method below.
# crontab -e
Then add the line at the beginning
Save the crontab.
Generate random number in Perl
Answer:
To generate a random number in Perl, e.g. 10 to 20 (inclusive)
my $max = 10;
my $min = 10;
my $random = int( rand( $max-$min +1 ) ) + $min;
Remove default Debian/Ubuntu default Apache welcome page
Answer:
To remove the Apache default welcome page under Debian/Ubuntu,
1. Remove the welcome page configuration
# a2dissite default
2. Restart Apache
# sudo /etc/init.d/apache2 restart
That's all.
Turn off InnoDB support in MySQL
Answer:
If you never use the InnoDB storage engine in MySQL, it is better to disable it.
To disable this feature, edit the MySQL configurations, e.g. /etc/my.cnf
[mysqld]
...
...
skip-innodb
Add the "skip-innodb" will do the tricks for you.
Don't forget to restart MySQL to take effect.
# /sbin/service mysqld restart