Tag Archive | "mysql"

Tags:

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On Ubuntu 11.04

Posted on 21 June 2011 by Chris

Nginx (pronounced "engine x") is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption. This tutorial shows how you can install Nginx on an Ubuntu 11.04 server with PHP5 support (through PHP-FPM) and MySQL support.

Read more

Comments (0)

Tags: ,

Installing Apache2 With PHP5 And MySQL Support On CentOS 5.6 (LAMP)

Posted on 16 June 2011 by Chris

LAMP is short for Linux, Apache, MySQL, PHP. This tutorial shows how you can install an Apache2 webserver on a CentOS 5.6 server with PHP5 support (mod_php) and MySQL support.
Read more

Comments (0)

Tags:

The Perfect Server – Fedora 15 x86_64 ISPConfig 3

Posted on 30 May 2011 by Chris

This tutorial shows how to prepare a Fedora 15 server (x86_64) for the installation of ISPConfig 3, and how to install ISPConfig 3. ISPConfig 3 is a webhosting control panel that allows you to configure the following services through a web browser: Apache web server, Postfix mail server, MySQL, BIND nameserver, PureFTPd, SpamAssassin, ClamAV, and many more.
Read more

Comments (0)

Tags:

NagiosQL – Configure Nagios from the web

Posted on 16 April 2011 by Chris

NagiosQL is a web based administration tool for Nagios 2.x, 3.x and Icinga 1.x. It helps you to easily build a complex configuration with all options, manage and use them. NagiosQL is based on a webserver with PHP, MySQL and local file or remote access to the Nagios configuration files via ssh or ftp .The product relies on a Mysql DB which keep all the configurations for Nagios, there is also the option “dump to disk” which writes all configuration files of Nagios, you can also import from Nagios configuration text files to the database.
Read more

Comments (0)

Tags:

Show Grants for a MySQL User

Posted on 06 March 2011 by Chris

To show the granted permissions for a MySQL username, first you will need to know the username that you need to check on. In this article, the username will be test_db. So, to show the information for the user, you will first drop into the mysql shell.

root@server [/]#mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 0001
Server version: 5.0.91-community MySQL Community Edition (GPL)

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

mysql>

Then, you use the show grants command to show the granted permissions for that MySQL user.

mysql> show grants for ‘test_db’@'localhost’;
+————————————————————————————————————————————————————————————————–+
| Grants for test_db@localhost |
+————————————————————————————————————————————————————————————————–+
| GRANT USAGE ON *.* TO ‘test_db’@'localhost’ IDENTIFIED BY PASSWORD ‘*DYC75DW0KD63D82OEGMCF334LKSUTAQQLUDRW’ |

| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE ON `test\_db`.* TO ‘test_db’@'localhost’ |
+————————————————————————————————————————————————————————————————–+
2 rows in set (0.00 sec)

You can tell the database that it it granted the permissions to from this part of that statement, where test\_db is the database test_db.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE ON `test\_db`.* TO ‘test_db’@'localhost’ |

Comments (0)

Tags:

Check the storage engines for MySQL

Posted on 28 January 2011 by Chris

If you need to find out the available storage engines for MySQL, such as InnoDB, you can run the following command.

mysql -Bse 'show engines'

That will output the engines and their availability, and will look something like this.

root@server [~]# mysql -Bse ‘show engines’
MyISAM  DEFAULT Default engine as of MySQL 3.23 with great performance
MEMORY  YES     Hash based, stored in memory, useful for temporary tables
InnoDB  YES     Supports transactions, row-level locking, and foreign keys
BerkeleyDB      YES     Supports transactions and page-level locking
BLACKHOLE       NO      /dev/null storage engine (anything you write to it disappears)
EXAMPLE NO      Example storage engine
ARCHIVE NO      Archive storage engine
CSV     NO      CSV storage engine
ndbcluster      NO      Clustered, fault-tolerant, memory-based tables
FEDERATED       NO      Federated MySQL storage engine
MRG_MYISAM      YES     Collection of identical MyISAM tables
ISAM    NO      Obsolete storage engine

Comments (0)

Tags:

Enable and disable a Drupal module from the command line

Posted on 11 January 2011 by Chris

To disable or enable a Drupal module from the command line, you will need to edit the MySQL database. First, you will select the database that you need to edit, then use the select command to see the current status of the module, then the update command to change the status of the module.  So, first, you drop into MySQL command line and choose the database that your Drupal installation uses:

]#mysql drupal_db

then use the select command to check the current status of the modules

mysql>SELECT name,status FROM system WHERE type='modulename';

That will output the current status of all of the modules.  Then, you can use the update command to disable the module

mysql>UPDATE system SET status='0' WHERE name='modulename';

Or you can replace the 0 with a 1 to enable a module.

mysql>UPDATE system SET status='1' WHERE name='modulename';

(replacing modulename with the name of the module that you would like to enable or disable.)

Comments (2)

Tags:

Delete and recreate a MySQL database

Posted on 10 January 2011 by Chris

You can delete a mysql database by going into the mysql command prompt and using the drop database command.  Therefore, if you have a database named data_base that you would like do delete, you can do the following:

#mysql
mysql>drop database data_base;

Then, to recreate that database, use the create database command

mysql>create database data_base;

Comments (0)

Tags:

Restore a MySQL database from a .sql file

Posted on 08 January 2011 by Chris

You are able to use the command line to restore a database using the mysql command.  To restore a file named backup.sql to the database data_base, first make sure that the database is empty, then you can run

mysql -o data_base < backup.sql 

It is good to use mysql -o when restoring the database, which makes sure to only affect the database that you specify in the command.

Comments (0)





Download v1 of the RandomLinux.com Android app! Stay up to date on everything that's Linux right from your phone or tablet! Download below!