Drop a database in MongoDB
Answer:
Assuming you are going to drop the `test` database in MongoDB, follow the steps below to drop (delete) it.
> use test
switched to db test
> db.dropDatabase()
{ "dropped" : "test.$cmd", "ok" : 1 }
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Drop a database in MongoDB
Answer:
Assuming you are going to drop the `test` database in MongoDB, follow the steps below to drop (delete) it.
> use test
switched to db test
> db.dropDatabase()
{ "dropped" : "test.$cmd", "ok" : 1 }
Set the maximum execution time in PHP
Answer:
The default maximum execution time in PHP is 30 seconds. If you want to change it, you need to edit the php.ini
vi /etc/php.ini
Locate and set
max_execution_time = 120;
Try it with the number you need.
Also, remember to restart web server such as Apache if needed.
How to show MySQL binlog contents in Linux
Answer:
To view the MySQL binlog file, you can use the mysqlbinlog command.
E.g.
# mysqlbinlog localhost-bin.000002
Show all tables started with a prefix in MySQL
Answer:
If your database has a lot of tables, and you want to list all the tables started with a name prefix, you can try:
mysql> SHOW TABLES LIKE 'cache%';
+--------------------------------+
| Tables_in_mydb (cache%) |
+--------------------------------+
| cache |
| cache_block |
| cache_bootstrap |
| cache_field |
| cache_filter |
| cache_form |
| cache_image |
| cache_menu |
| cache_page |
| cache_path |
| cache_update |
+--------------------------------+
11 rows in set (0.00 sec)
Lists the package to which a particular file belongs in Ubuntu
Answer:
Sometimes, you want to know which package contains a file, e.g. "php5.conf", you can try
# dpkg -S php5.conf
libapache2-mod-php5: /etc/apache2/mods-available/php5.conf