MySQL Chinese reference manual

Source: Internet
Author: User
Tags manual file system mysql database linux

This is a development of the Linux file system, Linux can be the MySQL database as a file system to deal with. The development team would like to get more advice, as the following article translates from:

In fact, this is not the usual file system, it does not have disk space, but instead uses the MySQL daemon to store the data. You can implement SQL tables and some functions through the file system.

First, how to achieve?

Let's take a look at the usage example:

[root@localhost/root]# mount-t corbafs-o ' Cat/tmp/mysqlcorbafs.ior ' None
/mnt/mysql/
[root@localhost/root]# Mount
/dev/hda3 on/type ext2 (rw)
None On/proc type proc (rw)
None on/dev/pts type devpts (rw,gid=5,mode=620)
/DEV/HDA1 On/mnt/win type VFAT (rw,mode=777)
/DEV/HDA4 on/mnt/linux type VFAT (rw,noexec,nosuid,nodev,mode=777)
None On/mnt/mysql type Corbafs
(rw,ior:01e50d401b00000049444c3a436f72626146532f46696c6553797374656d3a312e
300000010000000000000030000000010100000a0000003132372e302e302e310008041800
0000000000009224bc335663462a01000000ef7ae13c0943c59f)
[root@localhost/root]# ls-la/mnt/mysql/
Total 0
-r-xr-xr-x 1 root root 4096 dets 22:21. Uptime
Dr-xr-xr-x 1 root 4096 dets 22:21 test
Dr-xr-xr-x 1 root root 4096 dets 22:21 MySQL
[root@localhost/root]# Cat/mnt/mysql/.uptime
1994
[root@localhost/root]# Cat/mnt/mysql/mysql/user/host
cpq.spam.ee
cpq.spam.ee
localhost
localhost
localhost
localhost
localhost
localhost
[root@localhost/root]# Cat/mnt/mysql/mysql/user/insert_priv
N
N
N
N
N
N
Y
Y
[root@localhost/root]# umount/mnt/mysql/

Second, why do you do this?

In some cases, doing so can make work easier. MySQL and file systems can be called databases, but with a very different concept and advantages and disadvantages. In a file system, objects can be quick and easy to find, even changing names can be quickly found. Every beginner should probably learn to move/copy/rename/delete such an operation. But unlike SQL, he manipulates the data stored on the file system through an application. and MySQL file system to do the user-level SQL. Users can manipulate the database in the way they know it.

-Any new product that requires access to data over the network must support some protocols and other possible ways to access the file system over the network. MySQL tables can be accessed in this way, even if MySQL is not ported to the corresponding platform.

-Backup and versioning, the normal file system can be implemented by any backup software. The data can be compared by diff and used CVs to control the version.

-Shorter programming times, sometimes people need to save simple data, like the current date or the name of the site, these data rarely change, common methods need to use:

Connect server-> Select Database-> execute command-> store results

And the use of MySQL file system, only need a word: (PHP implementation)

Include (¨/mountpoint/database/table/field¨);

Or, in another way, to express:

Include (¨/mnt/mysql/sitedata/topic/todaytopic¨);

This is easy to understand and takes up less space. You can also share/mnt/mysql through Samba to directly modify the SQL database. Writing text to a database directly or using a copy/paste feature to put a picture into a database is much less labor-saving than writing a hundreds of-line program in Perl or PHP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.