Installing a new database server

From Edgar BV Wiki
Revision as of 08:14, 30 August 2017 by Red (talk | contribs) (Created page with "= Packages = <pre> apt-get install mysql-server phpmyadmin </pre> From Debian 9 this will install MariaDB = Initial setup = run <pre> mysql_secure_installation </pre> to set...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Packages

apt-get install mysql-server phpmyadmin

From Debian 9 this will install MariaDB

Initial setup

run

mysql_secure_installation

to set up a root password and delete the test database

notes on root

Nowadays when you are logged in to bash as root, you can enter mariadb by just running mariadb / mysql and will not be prompted for a password! However, you can also not enter mysql as root from another user or from phpmyadmin! [1]

So to fix this, we enter mysql and do:

update mysql.user set plugin = 'mysql_native_password' where User='root';
flush privileges;

Create a new database

create user user@localhost identified by 'somepass';
create database dbname;
grant all on dbname.* to user@localhost;
flush privileges;