forked from bianster/mysqlfs
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME
122 lines (83 loc) · 3.52 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
mysqlfs - MySQL FileSystem
MySQLfs is a FUSE filesystem driver which stores files in a MySQL database.
===> Requirements
To use this package you need:
- mysql-client libraries 5.0 or later on the local machine
- A MySQL server 5.0 or later somewhere on the network (or on the local machine)
- fuse 2.6 or later
===> Building instruction
To build the package you need:
- CMake
- fuse-devel libs
- mysql-devel libs
On FreeBSD 12.x or later you can install requirements with.
#> pkg install mysql80-client cmake gmake fusefs-libs
And remember to kldload fusefs before starting MySQLfs
On Debian 9 you can install requirements with:
#> sudo apt install -y cmake g++ libfuse-dev libmariadbclient-dev-compat
Run the following commands:
#> cmake .
#> make
#> make install
Instead of last command 'make install' you can use 'checkinstall' to build the DEB-package.
===> First installation / upgrading
NOTE: if you are upgrading skip directly to step #2
1. Create a database and a MySQL account
mysql> CREATE DATABASE mysqlfs;
mysql> GRANT ALL PRIVILEGES ON mysqlfs.* TO mysqlfs@"%" IDENTIFIED BY 'pass';
mysql> FLUSH PRIVILEGES;
2. Execute mysqlfs_setup and answer to the questions about your db.
4. Mount the filesystem (please change the parameters <> accordingly)
$ mkdir /mnt/fs
$ mysqlfs -ohost=<host> -ouser=<user> -opassword=<pass> -odatabase=<mysqlfs> /mnt/fs
5. Instead of setting connection options on the command line
you may create a [mysqlfs] section in your ~/.my.cnf file and
set the parameters there.
6. Mount on boot: add into /etc/fstab the next line
mysqlfs /mnt/fs fuse host=<host>,user=<user>,password=<pass>,database=<mysqlfs>,allow_other,big_writes,x-systemd.automount 0 2
===> Upgrading from 0.4.0 or lower versions
To upgrade your existing installation unfortunately you have to make some changes
to the database.
The recomended solution to upgrade your system is to compile a a newMySQLfs and
create a NEW filesystem in a NEW database. Mount it alongside the old one and then
just copy datas from the old filesystem to the new one. THIS IS THE RECOMENDED
(AND PROBABILY THE ONLY CERTAIN) SOLUTION.
IN THE SQL DIR YOU CAN FIND A 0.4.0_to_0.4.1.sql FILE, BUT IT IS "INFORMATIVE"
ONLY - IT'S NOT MEANT TO BE RUN ON A RUNNING FILESYSTEM
The problem lies in the handling of "sparse files": increasing the blocksize
without proper remapping of the underlying database can cause improper results.
More specifically your files will probably get filled with zeroes. You probably
don't want that.
===> Running options
-ohost=<hostname>
MySQL server host
-ouser=<username>
MySQL username
-opassword=<password>
MySQL password
-odatabase=<db>
MySQL database name
-obig_writes
Enable big_writes (strongly suggested)
-oallow_other
Enable filesystem access to different users than the one who mounted it.
The corresponding option must be enabled in /etc/fuse.conf
-odefault_permissions
Disable some extended permission checkings on files.
===> Compatibility Matrix
During development mysqlfs is checked against:
* FreeBSD 10
* Fedora Linux 15
* Debian Linux 6
* Debian Linux 7
* Debian Linux 9
* MySQL 5.1
* MySQL 5.5
* MySQL 5.6
* MariaDB 10.1
NOTE:
* FreeBSD 9 + FUSE-KMOD is NOT supported
===> Authors
Copyright (C) 2006 Tsukasa Hamano <[email protected]>
Copyright (C) 2006 Michal Ludvig <[email protected]>
Copyright (C) 2012-2020 Andrea Brancatelli <[email protected]>