oasysweb
By:
oasysweb

Stuck trying to creating a new mysql database

March 20, 2017 430 views
MySQL Ubuntu 16.04

Hello,

So i am trying to create a new database, and every time i try the

CREATE DATABASE database name;

I get the error below

1044 - Access denied for user 'phpmyadmin'@'localhost'

i tried the ['AllowNoPassword'] = TRUE; method and i still wasn't able to create a database within the installed phpmyadmin

i tried using root with the admin password but that didint work

Any ideas?

1 Answer

@oasysweb

When you create a database from the CLI, you should use two commands; one to create the db and one to create the user.

Creating the Database

create database mydb;

Creating the User

grant all on mydb.* to 'myuser'@'localhost' identified by 'mypassword';

The above grants all privileges to myuser on mydb using mypassword. Capitalization doesn't matter in this case, though the single quotes do, so make you you keep those in place.

As far as phpMyAdmin, normally I recommend going with a solution that's far easier to manage, and that would be Adminer. Instead of hundreds of files, it's a single file:

https://github.com/vrana/adminer/releases/download/v4.3.0/adminer-4.3.0.php

You'll download the above, upload it to any directory you wish, and then login as normal.

Have another answer? Share your knowledge.