MySQL permissions and privileges problems

I face a problem with the access to MySQL. I need to create and import a database but my default user have no necessary privileges to do it.

I am using Ubuntu 16.04, additional details about OS and platform:

# uname -a
Linux improve1 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:36:54 UTC 2017 i686 i686 i686 GNU/Linux

This is my MySQL version:

# mysql --version
mysql Ver 14.14 Distrib 5.7.17, for Linux (i686) using EditLine wrapper

The only user created (I was allowed to create only it) during installation is named "phpmyadmin".

If I make attempt to use this user privileges using phpMyAdmin (at ) I see "No Privileges"

If try to do it after console login I have the following problem:

mysql> CREATE DATABASE bulterm;
ERROR 1044 (42000): Access denied for user 'phpmyadmin'@'localhost' to database 'bulterm'

When I check the privileges of this user I see the following:

mysql> SHOW GRANTS FOR 'phpmyadmin'@'localhost';
+--------------------------------------------------------------------+
| Grants for phpmyadmin@localhost |
+--------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'phpmyadmin'@'localhost' |
| GRANT ALL PRIVILEGES ON `phpmyadmin`.* TO 'phpmyadmin'@'localhost' |
+--------------------------------------------------------------------+
2 rows in set (0,00 sec)

But when I try to execute any operation like creating database, creating new user etc., I am restricted.

I want to create a MySQL user "root" with full privileges to do everything.

How can I resolve my problem?

2

3 Answers

In three steps:

sudo systemctl stop mysql
sudo dpkg-reconfigure mysql-server-5.7
sudo systemctl start mysql

The middle steps will allow you to change the root password.

3

Try to Login user root and password same you are using with your Mysql User

Phpmyadmin panel will open and follow the steps:

1) goto users 2) check if your user exists for mysql users

User Host Password Global privileges Grant Action

3) click on Edit Privileges for specific user

4) Check Mark all global Privileges and Go

5) Login with your current user It will access to create and allow permission

Thanks..!!

2

You need to open phpmyadmin.conf from the dbconfig-common folder and change the database user name from "phpmyadmin" to "root":

sudo gedit /etc/dbconfig-common/phpmyadmin.conf
# dbc_dbuser: database user
# the name of the user who we will use to connect to the database.
dbc_dbuser='root'
# dbc_dbpass: database user password
# the password to use with the above username when connecting
# to a database, if one is required
dbc_dbpass='12345'
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like