This is very simple, you can try as follows:
% eyedbdbcreate fooor more simply:
% dbcreate fooIf you use the default installation configuration, the following message will be displayed:
eyedbdbcreate: insufficient privileges: user 'guest': creating database 'foo'This mean that all is ok: you - in fact user guest - was not authorized to create a database.
Two questions:
The answer to the first question is very simple: because the default configuration file iseyedbtop/eyedb-V2.7.3/archdir/etc/ArchConfig which includes the following lines:
# # Default Authentication # user = guest; passwd = guest;The answer to the second question is a little bit more complex.
If you display the user guest as follows:
% eyedbuserlist guest name : "guest" sysaccess : idbNoSysAccessModethe second line indicates that the user guest has no system access privileges:
The system access privileges control the following operations:
To create a database, one needs the first system access privilege.
So how to create a database? There are two ways:
We are going to introduce these two ways.
% eyedbuserlist name : "eyedbroot" sysaccess : idbSuperUserSysAccessMode name : "eyedb" [strict unix user] sysaccess : idbSuperUserSysAccessMode name : "guest" sysaccess : idbNoSysAccessModeYou can notice that eyedbroot and eyedb - mentionned as a strict unix user - have the super user system privilege which means that they can perform any operation on any database. The difference between these two users is beyond the scope of this manual. In this Section, we will use the eyedbroot user.
To create a database using the eyedbroot user, you need to do as follows:
% eyedbdbcreate foo -U eyedbroot -P
password authentication : {eyedbroot password}
You need to type the eyedbroot password that has been entered
during the installation process (the embraces around the password means that
these characters are not echoed on your terminal).
The simplest way is to use the EYEDB superuser eyedbroot.
Note that an EYEDB user is not a UNIX user. EYEDB provides its own user management. But an EYEDB user can be mapped on a UNIX user. Refer to the security section of the administation manual to get all information about that.
Let's assume you want to add the user bill, and try this:
% eyedbuseradd billOnce again, an error message will be displayed:
eyedbuseradd: insufficient privileges: user 'guest': adding userbecause you need to perform this operation under the user eyedbroot and you are still user guest.
So, you need to use the option -eyedbauth? as follows:
% eyedbuseradd -U eyedbroot -P {eyedbroot password} bill
bill password: {thekid}
retype bill password: {thekid}
If no error messages appear, the operation is sucessful.
Now, you need to add the any database creation system privilege to the user bill.
Try this:
% eyedbsysaccess usage: eyedbsysaccess <username> ['+' combination of] dbcreate|adduser|deleteuser|setuserpasswd|admin|superuser|noAs shown above, the usage is displayed on your terminal.
For instance if you want to set the database creation and the user creation system privileges:
% eyedbsysaccess -U eyedbroot -P {eyedbroot password} bill dbcreate+adduser
password authentication: {eyedbroot}
% eyedbdbcreate -U bill -P {bill password} foo
or as follows:
% eyedbdbcreate foo --user=bill --passwd=thekidNice, isn't it?
The problem is that you need to type your user and password each time you want to become the user bill because of the default configuration you are still the user guest, and this user cannot acces the database foo for read or write operations.
For instance, try:
% eyedboql -d foo insufficient privileges: user 'guest': opening database 'foo'Of course, it is possible to allow the user guest to perform read or write operations on the database foo, but it will be more clever to become the user bill.
include //etc/ArchConfig user = bill; passwd = thekid;Change the file access mode to 0600 for security reasons, as follows:
% chmod 0600 EyeDBConfigthen, set the environment variable EYEDBCONF to this file as follows:
% EYEDBCONF=~/EyeDBConfig; export EYEDBCONF # for Bourne Shells % setenv EYEDBCONF ~/EyeDBConfig # for C ShellsTo check, if this operation worked, try:
% eyedbgetenv version 2.6.6 % eyedbgetenv user billif the good version number 2.7.3 and bill are displayed, the operation has succeeded.
Now you can try again:
% eyedboql -d foo Welcome to eyedboql. Type `!help' to display the command list. ?this is better. Type !quit or Control-D to exit from eyedboql.