Linux LVM: Reduce Filesystem and Logical Volume
March 14, 2012 – 5:07 pm | No Comment

The following example shows how to reduce the size of a filesystem mounted on an LVM logical volume. The instructions below are only for non-root filesystems. No reboot is required, but the filesystem will need to be unmounted. So, if there are any user applications using this filesystem, they will need to be stopped and the users will need to log out.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » MySQL

The correct MySQL GRANT syntax

Submitted by on September 21, 2006 – 12:18 pmOne Comment
The correct MySQL GRANT syntax

It is surprising how many people run into problems trying to use the GRANT command: everything from not being able to access a database table to losing admin access to MySQL altogether. There’s a bunch of Web sites giving incorrect examples of using this command. Among these sites is, surprisingly, mysql.org. So, to save humanity, here’s my take on the GRANT issue and pay attention to the use of single and double quotes.

Example 1

Let’s say you want to create a new database called “my_drug_deals”, so you do this:

mysql -uroot -ppassword
mysql> CREATE DATABASE my_drug_deals ;
mysql> quit

Now, you want to connect to this DB as root from another machine and have full access. Here’s what you do:

mysql -uroot -ppassword
mysql> GRANT ALL PRIVILEGES ON my_drug_deals.* to root@'%' IDENTIFIED BY 'password' WITH GRANT OPTION ;
mysql> quit

This will make this database fully accessible to a “root” user connecting from ANY system, as long as the correct password is specified.

Popularity: 6% [?]

Related posts:

  1. Install PHP, Mysql, Apache2 on Solaris 9
  2. Exporting spreadsheet data to MySQL
  3. Apache MySQL PHP Solaris 8 Installation
  4. Using GNUPlot to chart MySQL data
  5. Find and Replace in MySQL

One Comment »

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.