Skip to content

Instantly share code, notes, and snippets.

@Hikingyo
Last active April 14, 2024 06:42
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save Hikingyo/549698845d166e49eb3d238d03d49236 to your computer and use it in GitHub Desktop.
Save Hikingyo/549698845d166e49eb3d238d03d49236 to your computer and use it in GitHub Desktop.
create admin user with all privileges on mysql/mariadb
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
## remote connection - not secure
CREATE USER 'admin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
@Hikingyo
Copy link
Author

Hikingyo commented Dec 29, 2017

Update phpMyAdmin

Using sudo, edit /etc/dbconfig-common/phpmyadmin.conf file updating user/password values in the following sections (replacing some_pass 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='some_pass'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment