-
Create a new database in MySQL and grant privileges to a Hue user to manage this database.
mysql> create database hue; Query OK, 1 row affected (0.01 sec) mysql> grant all on hue.* to 'hue'@'localhost' identified by 'secretpassword'; Query OK, 0 rows affected (0.00 sec)
- Shut down Hue if it is running.
-
To migrate your existing data to MySQL, use the following command to dump the existing database data to a text file. Note that using the ".json" extension is required.
$ /usr/share/hue/build/env/bin/hue dumpdata > <some-temporary-file>.json
-
Open the
hue.inifile in a text editor. Directly below the[[database]]line, add the following options (and modify accordingly for your MySQL setup):host=localhost port=3306 engine=mysql user=hue password=secretpassword name=hue
-
As the Hue user, configure Hue to load the existing data and create the necessary database tables:
$ /usr/share/hue/build/env/bin/hue syncdb --noinput $ mysql -uhue -psecretpassword -e "DELETE FROM hue.django_content_type;" $ /usr/share/hue/build/env/bin/hue loaddata <temporary-file-containing-dumped-data>.json
Your system is now configured and you can start the Hue server as normal.
Note: The above commands will produce some errors when the hue daemon has been installed without
mysql configuration.
My practise is that alter the database config in hue.ini in the original tarball and then run
PREFIX=/path/to/hue-install-parent-dir make install
a. delete the old hue database in mysql
b.
#hue syncdb --noinput #hue migrate
References
http://cloudera.github.io/hue/docs-3.5.0/manual.html
本文介绍了如何在MySQL中为Hue创建新的数据库并授予权限,包括迁移现有数据的具体步骤。涉及MySQL命令、Hue配置文件修改及使用Hue命令进行数据同步等内容。

被折叠的 条评论
为什么被折叠?



