Main Menu

search

You are here

pHp myAdmin Notes

PHP
-----

    1. Connect to mysql:
    $ sudo mysql --user=root mysql

    2. Create a real password

    3. Create a user for phpMyAdmin:
    mysql> CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY '[newPassword]';
    mysql> GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
    mysql> FLUSH PRIVILEGES;

    4. Optional and unsafe: allow remote connections

    Remember: allow a remote user to have all privileges is a security concern and this is not required in most of cases.

    With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing
    by the password used in Step #2):

    CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY '
    ';
    GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

    5. Update phpMyAdmin

    Using sudo, edit /etc/dbconfig-common/phpmyadmin.conf file updating user/password values in the following sections (replacing
    by the password used in Step #2):

    # dbc_dbuser: database user
    # the name of the user who we will use to connect to the database.
    dbc_dbuser='phpmyadmin'

    # dbc_dbpass: database user password
    # the password to use with the above username when connecting
    # to a database, if one is required
    dbc_dbpass='
    '

.

.

.

eof