Cannot enter phpmyadmin as root (MySQL 5.7)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
41
down vote
favorite
I'm using Ubuntu desktop 16.04 (upgraded from 15.10).
I had installed phpmyadmin from by apt-get install phpmyadmin
. It works if I go to localhost/phpmyadmin
but I cannot log into it as root.
I have searched a lot for it. I have found many sources in which they suggest to alter /etc/phpmyadmin/config.inc.php
and replace the user and password with 'root' and '' (empty for password). But my config.inc.php
is different from theirs. For example in my file, there is no line for user and password and it seems it gets it automatically from another file which is /etc/phpmyadmin/config-db.php
. Despite this, I have changed the user and password in that file, but now I get this error:
#1698 - Access denied for user 'root'@'localhost'
What I should do?
Phpmyadmin Version: 4.5.4.1deb2ubuntu1
mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
mysql phpmyadmin
add a comment |Â
up vote
41
down vote
favorite
I'm using Ubuntu desktop 16.04 (upgraded from 15.10).
I had installed phpmyadmin from by apt-get install phpmyadmin
. It works if I go to localhost/phpmyadmin
but I cannot log into it as root.
I have searched a lot for it. I have found many sources in which they suggest to alter /etc/phpmyadmin/config.inc.php
and replace the user and password with 'root' and '' (empty for password). But my config.inc.php
is different from theirs. For example in my file, there is no line for user and password and it seems it gets it automatically from another file which is /etc/phpmyadmin/config-db.php
. Despite this, I have changed the user and password in that file, but now I get this error:
#1698 - Access denied for user 'root'@'localhost'
What I should do?
Phpmyadmin Version: 4.5.4.1deb2ubuntu1
mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
mysql phpmyadmin
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14
add a comment |Â
up vote
41
down vote
favorite
up vote
41
down vote
favorite
I'm using Ubuntu desktop 16.04 (upgraded from 15.10).
I had installed phpmyadmin from by apt-get install phpmyadmin
. It works if I go to localhost/phpmyadmin
but I cannot log into it as root.
I have searched a lot for it. I have found many sources in which they suggest to alter /etc/phpmyadmin/config.inc.php
and replace the user and password with 'root' and '' (empty for password). But my config.inc.php
is different from theirs. For example in my file, there is no line for user and password and it seems it gets it automatically from another file which is /etc/phpmyadmin/config-db.php
. Despite this, I have changed the user and password in that file, but now I get this error:
#1698 - Access denied for user 'root'@'localhost'
What I should do?
Phpmyadmin Version: 4.5.4.1deb2ubuntu1
mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
mysql phpmyadmin
I'm using Ubuntu desktop 16.04 (upgraded from 15.10).
I had installed phpmyadmin from by apt-get install phpmyadmin
. It works if I go to localhost/phpmyadmin
but I cannot log into it as root.
I have searched a lot for it. I have found many sources in which they suggest to alter /etc/phpmyadmin/config.inc.php
and replace the user and password with 'root' and '' (empty for password). But my config.inc.php
is different from theirs. For example in my file, there is no line for user and password and it seems it gets it automatically from another file which is /etc/phpmyadmin/config-db.php
. Despite this, I have changed the user and password in that file, but now I get this error:
#1698 - Access denied for user 'root'@'localhost'
What I should do?
Phpmyadmin Version: 4.5.4.1deb2ubuntu1
mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
mysql phpmyadmin
mysql phpmyadmin
edited Apr 28 '16 at 18:07
Dan
6,71434273
6,71434273
asked Apr 26 '16 at 18:52
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
Mostafa Ahangarha
2,47941942
2,47941942
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14
add a comment |Â
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14
add a comment |Â
8 Answers
8
active
oldest
votes
up vote
84
down vote
accepted
MySQL 5.7 changed the secure model: now MySQL root
login requires a sudo
.
I.e., phpMyAdmin will be not able to use root
credentials.
The simplest (and safest) solution will be create a new user and grant required privileges.
1. Connect to mysql
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
3. Optional: allow remote connections
Remember: allow a remote user to have all privileges is a security concern.
With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing some_pass
by the password used in Step #2):
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4. 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'
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
@MostafaAhangarha After investigate, I found that blank password is allowed, butroot
user always required thesudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.
â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
 |Â
show 5 more comments
up vote
7
down vote
I was facing the same problem when using mariaDB with phpmyadmin (Ubuntu 16.04LTS).
Prerequisites:
1) Install MariaDB
sudo apt-get -y install mariadb-server mariadb-client
sudo mysql_secure_installation (answer to some interactive questions):
Enter current password for root (enter for none): <enter>
Set root password: n
Remove anonymous users: n
Disallow root login remotely: n
Remove test database and access to it: n
Reload privilege tables now: Y
If you want to uninstall mariaDB
:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2) Install phpmyadmin
sudo apt-get -y install phpmyadmin (and answer some interactive questions)
Configuring phpmyadmin:
Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common: Yes
MySQL application password for phpmyadmin: <blank>
3) In apache2, create a symbolic link to phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
Ok, now, if you follow Rael's instructions, you'll be able to login into phpmyadmin
, but, at least for me, I wasn't able to create new databases, as a red message came up: No privileges
(or some similar message)
The fix was by reconfiguring phpmyadmin, and by answering some interactive questions.
sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin
) using
username: root
password: pass
you'll be able to create databases.
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does runningsudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.
â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
add a comment |Â
up vote
3
down vote
In Ubuntu 16.04 for Mysql 5.7 check below table information and perform necessary settings:
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| phpmyadmin | localhost | mysql_native_password |
| root | % | mysql_native_password |
+------------------+-----------+-----------------------+
Check if root is having auth_socket plugin then run below command:
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
add a comment |Â
up vote
2
down vote
For completeness, I've found a solution to my trouble in using MariadB version 10.1.23. The syntax to use in order to setup a new user is similar to one reported into the post above from @Rael Gugelmin Cunha, I put here my solution for reference to others facing same trouble:
root@raspberrypi:# sudo mysql --user=root mysql
use mysql;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Regards
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
add a comment |Â
up vote
1
down vote
Referring to Rael Cunha:
Yes his solution works, and I have tried others. However, referring to a user having an exposed password on a configuration file like /etc/dbconfig-common/phpmyadmin.conf
looks like a security flaw for a system-wide action.
So I would rather suggest in what MariaDB 10.1.x
is concerned (some_user and some_pass will be anything you may come up with):
# mysql -u root
use mysql;
CREATE USER 'some_user'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
and leaving phpadmin setup (4) as is.
Log in to phpmyadmin with your own credentials afterwards
On my own setups I replace the above '%' by 'localhost' for security purposes, but if you have port 3306 closed on your server that would not necessarily present a security risk to you.
add a comment |Â
up vote
1
down vote
If phpymadmin can't connect it may be due to the auth mechanism set to auth_socket
. You can change it to use a regular password like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password";
I was struggling with this just now on a clean install of Ubuntu 18.04 and this is what made it work. There's a decent article here explaining more:
https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
add a comment |Â
up vote
0
down vote
I had the same problem, I've followed most the advice and none of it worked for me! My issue was the same when I opened localhost/phpmyadmin in my browser it asked for the log in details.
I was adding root as user. and the password I knew was correct. and i was getting #1698 - Access denied for user 'root'@'localhost'
all it is use phpmyadmin as user not root, and the known password and opens.
hope this helps anyone, kinda funny how much I overlooked it. but work for me with that error #1698 - Access denied for user 'root'@'localhost'
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
add a comment |Â
up vote
-2
down vote
if you install MySQL separate stop it by this command below
sudo /opt/lampp/lampp stop
service mysql stop
sudo /opt/lampp/lampp start
add a comment |Â
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
84
down vote
accepted
MySQL 5.7 changed the secure model: now MySQL root
login requires a sudo
.
I.e., phpMyAdmin will be not able to use root
credentials.
The simplest (and safest) solution will be create a new user and grant required privileges.
1. Connect to mysql
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
3. Optional: allow remote connections
Remember: allow a remote user to have all privileges is a security concern.
With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing some_pass
by the password used in Step #2):
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4. 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'
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
@MostafaAhangarha After investigate, I found that blank password is allowed, butroot
user always required thesudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.
â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
 |Â
show 5 more comments
up vote
84
down vote
accepted
MySQL 5.7 changed the secure model: now MySQL root
login requires a sudo
.
I.e., phpMyAdmin will be not able to use root
credentials.
The simplest (and safest) solution will be create a new user and grant required privileges.
1. Connect to mysql
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
3. Optional: allow remote connections
Remember: allow a remote user to have all privileges is a security concern.
With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing some_pass
by the password used in Step #2):
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4. 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'
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
@MostafaAhangarha After investigate, I found that blank password is allowed, butroot
user always required thesudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.
â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
 |Â
show 5 more comments
up vote
84
down vote
accepted
up vote
84
down vote
accepted
MySQL 5.7 changed the secure model: now MySQL root
login requires a sudo
.
I.e., phpMyAdmin will be not able to use root
credentials.
The simplest (and safest) solution will be create a new user and grant required privileges.
1. Connect to mysql
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
3. Optional: allow remote connections
Remember: allow a remote user to have all privileges is a security concern.
With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing some_pass
by the password used in Step #2):
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4. 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'
MySQL 5.7 changed the secure model: now MySQL root
login requires a sudo
.
I.e., phpMyAdmin will be not able to use root
credentials.
The simplest (and safest) solution will be create a new user and grant required privileges.
1. Connect to mysql
sudo mysql --user=root mysql
2. Create a user for phpMyAdmin
Run the following commands (replacing some_pass
by the desired password):
CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
If your phpMyAdmin is connecting to localhost, this should be enough.
3. Optional: allow remote connections
Remember: allow a remote user to have all privileges is a security concern.
With this in mind, if you want this user to have the same privileges during remote connections, additionally run (replacing some_pass
by the password used in Step #2):
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
4. 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'
edited May 17 at 14:06
answered Apr 26 '16 at 19:35
![](https://i.stack.imgur.com/bVThG.gif?s=32&g=1)
![](https://i.stack.imgur.com/bVThG.gif?s=32&g=1)
Rael Gugelmin Cunha
3,5551827
3,5551827
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
@MostafaAhangarha After investigate, I found that blank password is allowed, butroot
user always required thesudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.
â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
 |Â
show 5 more comments
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
@MostafaAhangarha After investigate, I found that blank password is allowed, butroot
user always required thesudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.
â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
1
1
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
I'll investigate. As a workaround for in the meanwhile, you can add a new user and grant all permissions and then add this to phpmyadmin config file.
â Rael Gugelmin Cunha
Apr 27 '16 at 16:28
6
6
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
Got to love that MySQL keeps breaking things after upgrades. Was happily using root in my workbench and now it seems the only solution is to "sudo mysql" on the command line, create a new user, grant all the same privileges and use that in Workbench. Stupid.
â Andris
Apr 28 '16 at 8:49
3
3
@MostafaAhangarha After investigate, I found that blank password is allowed, but
root
user always required the sudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
@MostafaAhangarha After investigate, I found that blank password is allowed, but
root
user always required the sudo
usage on 5.7. So, I've updated the answer to guide create a new user with all privileges.â Rael Gugelmin Cunha
Apr 28 '16 at 16:16
2
2
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
@Andris This will force people to use MySQL in a more secure way. It is never a good idea to allow the root user on your database to login without a password anyway. It may be fine on a local development machine, but on a server it is very dangerous.
â Dan
Apr 28 '16 at 18:05
2
2
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
@Dan - that's my biggest gripe - it broke my local development environment after upgrading to Ubuntu 16.04 without any warnings. I don't mind stuff like this being the default for new installations but could at least ask before installing an update.
â Andris
Apr 28 '16 at 21:46
 |Â
show 5 more comments
up vote
7
down vote
I was facing the same problem when using mariaDB with phpmyadmin (Ubuntu 16.04LTS).
Prerequisites:
1) Install MariaDB
sudo apt-get -y install mariadb-server mariadb-client
sudo mysql_secure_installation (answer to some interactive questions):
Enter current password for root (enter for none): <enter>
Set root password: n
Remove anonymous users: n
Disallow root login remotely: n
Remove test database and access to it: n
Reload privilege tables now: Y
If you want to uninstall mariaDB
:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2) Install phpmyadmin
sudo apt-get -y install phpmyadmin (and answer some interactive questions)
Configuring phpmyadmin:
Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common: Yes
MySQL application password for phpmyadmin: <blank>
3) In apache2, create a symbolic link to phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
Ok, now, if you follow Rael's instructions, you'll be able to login into phpmyadmin
, but, at least for me, I wasn't able to create new databases, as a red message came up: No privileges
(or some similar message)
The fix was by reconfiguring phpmyadmin, and by answering some interactive questions.
sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin
) using
username: root
password: pass
you'll be able to create databases.
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does runningsudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.
â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
add a comment |Â
up vote
7
down vote
I was facing the same problem when using mariaDB with phpmyadmin (Ubuntu 16.04LTS).
Prerequisites:
1) Install MariaDB
sudo apt-get -y install mariadb-server mariadb-client
sudo mysql_secure_installation (answer to some interactive questions):
Enter current password for root (enter for none): <enter>
Set root password: n
Remove anonymous users: n
Disallow root login remotely: n
Remove test database and access to it: n
Reload privilege tables now: Y
If you want to uninstall mariaDB
:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2) Install phpmyadmin
sudo apt-get -y install phpmyadmin (and answer some interactive questions)
Configuring phpmyadmin:
Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common: Yes
MySQL application password for phpmyadmin: <blank>
3) In apache2, create a symbolic link to phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
Ok, now, if you follow Rael's instructions, you'll be able to login into phpmyadmin
, but, at least for me, I wasn't able to create new databases, as a red message came up: No privileges
(or some similar message)
The fix was by reconfiguring phpmyadmin, and by answering some interactive questions.
sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin
) using
username: root
password: pass
you'll be able to create databases.
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does runningsudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.
â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
add a comment |Â
up vote
7
down vote
up vote
7
down vote
I was facing the same problem when using mariaDB with phpmyadmin (Ubuntu 16.04LTS).
Prerequisites:
1) Install MariaDB
sudo apt-get -y install mariadb-server mariadb-client
sudo mysql_secure_installation (answer to some interactive questions):
Enter current password for root (enter for none): <enter>
Set root password: n
Remove anonymous users: n
Disallow root login remotely: n
Remove test database and access to it: n
Reload privilege tables now: Y
If you want to uninstall mariaDB
:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2) Install phpmyadmin
sudo apt-get -y install phpmyadmin (and answer some interactive questions)
Configuring phpmyadmin:
Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common: Yes
MySQL application password for phpmyadmin: <blank>
3) In apache2, create a symbolic link to phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
Ok, now, if you follow Rael's instructions, you'll be able to login into phpmyadmin
, but, at least for me, I wasn't able to create new databases, as a red message came up: No privileges
(or some similar message)
The fix was by reconfiguring phpmyadmin, and by answering some interactive questions.
sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin
) using
username: root
password: pass
you'll be able to create databases.
I was facing the same problem when using mariaDB with phpmyadmin (Ubuntu 16.04LTS).
Prerequisites:
1) Install MariaDB
sudo apt-get -y install mariadb-server mariadb-client
sudo mysql_secure_installation (answer to some interactive questions):
Enter current password for root (enter for none): <enter>
Set root password: n
Remove anonymous users: n
Disallow root login remotely: n
Remove test database and access to it: n
Reload privilege tables now: Y
If you want to uninstall mariaDB
:
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean
2) Install phpmyadmin
sudo apt-get -y install phpmyadmin (and answer some interactive questions)
Configuring phpmyadmin:
Web server to reconfigure automatically: apache2
Configure database for phpmyadmin with dbconfig-common: Yes
MySQL application password for phpmyadmin: <blank>
3) In apache2, create a symbolic link to phpmyadmin
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
sudo service apache2 restart
Ok, now, if you follow Rael's instructions, you'll be able to login into phpmyadmin
, but, at least for me, I wasn't able to create new databases, as a red message came up: No privileges
(or some similar message)
The fix was by reconfiguring phpmyadmin, and by answering some interactive questions.
sudo dpkg-reconfigure phpmyadmin
<Ok>
Reinstall database for phpmyadmin: <Yes>
Connection method for MySQL database server for phpmyadmin: TCP/IP
Host name of the MySQL database server for phpmyadmin: localhost
Port number for the MySQL service: 3306
MySQL database name for phpmyadmin: phpmyadmin
<Ok>
MySQL username for phpmyadmin: root
MySQL application password for phpmyadmin: pass # OR ANY PASSWORD YOU WANT
Password confirmation: pass
Name of the database's administrative user: root
Web server to reconfigure automatically: apache2
An error occurred while installing the database: ignore
Now if you try connect into phpmyadmin (localhost/phpmyadmin
) using
username: root
password: pass
you'll be able to create databases.
answered Mar 19 '17 at 18:36
Dan Costinel
22129
22129
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does runningsudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.
â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
add a comment |Â
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does runningsudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.
â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
Thank you for your answer. But wasn't it better to just share the last part instead of the whole? I think the rest is not useful here?
â Mostafa Ahangarha
Mar 20 '17 at 17:02
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
@MostafaAhangarha Maybe the post is a little too long, but I always like to know to context in which an answer is given.
â Dan Costinel
Mar 20 '17 at 21:55
Does running
sudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.â Mostafa Ahangarha
Mar 21 '17 at 8:47
Does running
sudo dpkg-reconfigure phpmyadmin
have any connection to installing mariadb and unistalling mysql? If yes, then your information might be useful (might be because you are suggesting the removal of mysql which is the DB I am using and I will use). If not, then there is no point of giving it as the context. If I am wrong, make me correct.â Mostafa Ahangarha
Mar 21 '17 at 8:47
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
I only followed the reconfiguration and now it works.
â cwhisperer
Jun 20 at 8:46
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
Is it a good idea to have no password for the root account?
â kurdtpage
Sep 20 at 3:23
add a comment |Â
up vote
3
down vote
In Ubuntu 16.04 for Mysql 5.7 check below table information and perform necessary settings:
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| phpmyadmin | localhost | mysql_native_password |
| root | % | mysql_native_password |
+------------------+-----------+-----------------------+
Check if root is having auth_socket plugin then run below command:
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
add a comment |Â
up vote
3
down vote
In Ubuntu 16.04 for Mysql 5.7 check below table information and perform necessary settings:
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| phpmyadmin | localhost | mysql_native_password |
| root | % | mysql_native_password |
+------------------+-----------+-----------------------+
Check if root is having auth_socket plugin then run below command:
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
add a comment |Â
up vote
3
down vote
up vote
3
down vote
In Ubuntu 16.04 for Mysql 5.7 check below table information and perform necessary settings:
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| phpmyadmin | localhost | mysql_native_password |
| root | % | mysql_native_password |
+------------------+-----------+-----------------------+
Check if root is having auth_socket plugin then run below command:
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
In Ubuntu 16.04 for Mysql 5.7 check below table information and perform necessary settings:
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| root | localhost | auth_socket |
| mysql.session | localhost | mysql_native_password |
| mysql.sys | localhost | mysql_native_password |
| debian-sys-maint | localhost | mysql_native_password |
| phpmyadmin | localhost | mysql_native_password |
| root | % | mysql_native_password |
+------------------+-----------+-----------------------+
Check if root is having auth_socket plugin then run below command:
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
edited Jul 25 at 11:28
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
Mostafa Ahangarha
2,47941942
2,47941942
answered Jul 25 at 9:44
Syed Abdul Qadeer
412
412
add a comment |Â
add a comment |Â
up vote
2
down vote
For completeness, I've found a solution to my trouble in using MariadB version 10.1.23. The syntax to use in order to setup a new user is similar to one reported into the post above from @Rael Gugelmin Cunha, I put here my solution for reference to others facing same trouble:
root@raspberrypi:# sudo mysql --user=root mysql
use mysql;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Regards
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
add a comment |Â
up vote
2
down vote
For completeness, I've found a solution to my trouble in using MariadB version 10.1.23. The syntax to use in order to setup a new user is similar to one reported into the post above from @Rael Gugelmin Cunha, I put here my solution for reference to others facing same trouble:
root@raspberrypi:# sudo mysql --user=root mysql
use mysql;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Regards
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
add a comment |Â
up vote
2
down vote
up vote
2
down vote
For completeness, I've found a solution to my trouble in using MariadB version 10.1.23. The syntax to use in order to setup a new user is similar to one reported into the post above from @Rael Gugelmin Cunha, I put here my solution for reference to others facing same trouble:
root@raspberrypi:# sudo mysql --user=root mysql
use mysql;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Regards
For completeness, I've found a solution to my trouble in using MariadB version 10.1.23. The syntax to use in order to setup a new user is similar to one reported into the post above from @Rael Gugelmin Cunha, I put here my solution for reference to others facing same trouble:
root@raspberrypi:# sudo mysql --user=root mysql
use mysql;
CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY 'some_password';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Regards
edited Jun 28 at 17:38
![](https://i.stack.imgur.com/jLgkr.jpg?s=32&g=1)
![](https://i.stack.imgur.com/jLgkr.jpg?s=32&g=1)
Thomas Wardâ¦
41.9k23115167
41.9k23115167
answered Jun 27 at 12:02
![](https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg?sz=32)
![](https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/photo.jpg?sz=32)
FIRE FOX
211
211
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
add a comment |Â
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
1
1
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
Welcome to Ask Ubuntu! Ask Ubuntu is for Ubuntu only, please do not post answers about Raspbian (based on Debian).
â ubashu
Jun 28 at 4:59
2
2
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
@ubashu This solution is not Raspbian specific, it's MariaDB specific.
â Thomas Wardâ¦
Jun 28 at 17:38
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
Thanks! Still no option to create new database though.
â danger89
Aug 18 at 22:08
add a comment |Â
up vote
1
down vote
Referring to Rael Cunha:
Yes his solution works, and I have tried others. However, referring to a user having an exposed password on a configuration file like /etc/dbconfig-common/phpmyadmin.conf
looks like a security flaw for a system-wide action.
So I would rather suggest in what MariaDB 10.1.x
is concerned (some_user and some_pass will be anything you may come up with):
# mysql -u root
use mysql;
CREATE USER 'some_user'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
and leaving phpadmin setup (4) as is.
Log in to phpmyadmin with your own credentials afterwards
On my own setups I replace the above '%' by 'localhost' for security purposes, but if you have port 3306 closed on your server that would not necessarily present a security risk to you.
add a comment |Â
up vote
1
down vote
Referring to Rael Cunha:
Yes his solution works, and I have tried others. However, referring to a user having an exposed password on a configuration file like /etc/dbconfig-common/phpmyadmin.conf
looks like a security flaw for a system-wide action.
So I would rather suggest in what MariaDB 10.1.x
is concerned (some_user and some_pass will be anything you may come up with):
# mysql -u root
use mysql;
CREATE USER 'some_user'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
and leaving phpadmin setup (4) as is.
Log in to phpmyadmin with your own credentials afterwards
On my own setups I replace the above '%' by 'localhost' for security purposes, but if you have port 3306 closed on your server that would not necessarily present a security risk to you.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Referring to Rael Cunha:
Yes his solution works, and I have tried others. However, referring to a user having an exposed password on a configuration file like /etc/dbconfig-common/phpmyadmin.conf
looks like a security flaw for a system-wide action.
So I would rather suggest in what MariaDB 10.1.x
is concerned (some_user and some_pass will be anything you may come up with):
# mysql -u root
use mysql;
CREATE USER 'some_user'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
and leaving phpadmin setup (4) as is.
Log in to phpmyadmin with your own credentials afterwards
On my own setups I replace the above '%' by 'localhost' for security purposes, but if you have port 3306 closed on your server that would not necessarily present a security risk to you.
Referring to Rael Cunha:
Yes his solution works, and I have tried others. However, referring to a user having an exposed password on a configuration file like /etc/dbconfig-common/phpmyadmin.conf
looks like a security flaw for a system-wide action.
So I would rather suggest in what MariaDB 10.1.x
is concerned (some_user and some_pass will be anything you may come up with):
# mysql -u root
use mysql;
CREATE USER 'some_user'@'%' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'some_user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
and leaving phpadmin setup (4) as is.
Log in to phpmyadmin with your own credentials afterwards
On my own setups I replace the above '%' by 'localhost' for security purposes, but if you have port 3306 closed on your server that would not necessarily present a security risk to you.
edited Mar 16 at 11:50
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
![](https://i.stack.imgur.com/LbQH9.jpg?s=32&g=1)
Mostafa Ahangarha
2,47941942
2,47941942
answered Feb 7 at 13:28
![](https://i.stack.imgur.com/sM8Gy.jpg?s=32&g=1)
![](https://i.stack.imgur.com/sM8Gy.jpg?s=32&g=1)
Antonio J. de Oliveira
394
394
add a comment |Â
add a comment |Â
up vote
1
down vote
If phpymadmin can't connect it may be due to the auth mechanism set to auth_socket
. You can change it to use a regular password like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password";
I was struggling with this just now on a clean install of Ubuntu 18.04 and this is what made it work. There's a decent article here explaining more:
https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
add a comment |Â
up vote
1
down vote
If phpymadmin can't connect it may be due to the auth mechanism set to auth_socket
. You can change it to use a regular password like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password";
I was struggling with this just now on a clean install of Ubuntu 18.04 and this is what made it work. There's a decent article here explaining more:
https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If phpymadmin can't connect it may be due to the auth mechanism set to auth_socket
. You can change it to use a regular password like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password";
I was struggling with this just now on a clean install of Ubuntu 18.04 and this is what made it work. There's a decent article here explaining more:
https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
If phpymadmin can't connect it may be due to the auth mechanism set to auth_socket
. You can change it to use a regular password like this:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password";
I was struggling with this just now on a clean install of Ubuntu 18.04 and this is what made it work. There's a decent article here explaining more:
https://www.percona.com/blog/2016/03/16/change-user-password-in-mysql-5-7-with-plugin-auth_socket/
answered Apr 29 at 5:34
![](https://i.stack.imgur.com/25izH.png?s=32&g=1)
![](https://i.stack.imgur.com/25izH.png?s=32&g=1)
billynoah
1,5182817
1,5182817
add a comment |Â
add a comment |Â
up vote
0
down vote
I had the same problem, I've followed most the advice and none of it worked for me! My issue was the same when I opened localhost/phpmyadmin in my browser it asked for the log in details.
I was adding root as user. and the password I knew was correct. and i was getting #1698 - Access denied for user 'root'@'localhost'
all it is use phpmyadmin as user not root, and the known password and opens.
hope this helps anyone, kinda funny how much I overlooked it. but work for me with that error #1698 - Access denied for user 'root'@'localhost'
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
add a comment |Â
up vote
0
down vote
I had the same problem, I've followed most the advice and none of it worked for me! My issue was the same when I opened localhost/phpmyadmin in my browser it asked for the log in details.
I was adding root as user. and the password I knew was correct. and i was getting #1698 - Access denied for user 'root'@'localhost'
all it is use phpmyadmin as user not root, and the known password and opens.
hope this helps anyone, kinda funny how much I overlooked it. but work for me with that error #1698 - Access denied for user 'root'@'localhost'
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I had the same problem, I've followed most the advice and none of it worked for me! My issue was the same when I opened localhost/phpmyadmin in my browser it asked for the log in details.
I was adding root as user. and the password I knew was correct. and i was getting #1698 - Access denied for user 'root'@'localhost'
all it is use phpmyadmin as user not root, and the known password and opens.
hope this helps anyone, kinda funny how much I overlooked it. but work for me with that error #1698 - Access denied for user 'root'@'localhost'
I had the same problem, I've followed most the advice and none of it worked for me! My issue was the same when I opened localhost/phpmyadmin in my browser it asked for the log in details.
I was adding root as user. and the password I knew was correct. and i was getting #1698 - Access denied for user 'root'@'localhost'
all it is use phpmyadmin as user not root, and the known password and opens.
hope this helps anyone, kinda funny how much I overlooked it. but work for me with that error #1698 - Access denied for user 'root'@'localhost'
answered Jun 15 at 21:02
![](https://i.stack.imgur.com/ymIGR.jpg?s=32&g=1)
![](https://i.stack.imgur.com/ymIGR.jpg?s=32&g=1)
plutesci
4214
4214
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
add a comment |Â
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
1
1
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
You mean username should be "phpmyadmin"?
â Mostafa Ahangarha
Jun 15 at 21:05
Yes it worked for me
â plutesci
Jun 16 at 2:47
Yes it worked for me
â plutesci
Jun 16 at 2:47
add a comment |Â
up vote
-2
down vote
if you install MySQL separate stop it by this command below
sudo /opt/lampp/lampp stop
service mysql stop
sudo /opt/lampp/lampp start
add a comment |Â
up vote
-2
down vote
if you install MySQL separate stop it by this command below
sudo /opt/lampp/lampp stop
service mysql stop
sudo /opt/lampp/lampp start
add a comment |Â
up vote
-2
down vote
up vote
-2
down vote
if you install MySQL separate stop it by this command below
sudo /opt/lampp/lampp stop
service mysql stop
sudo /opt/lampp/lampp start
if you install MySQL separate stop it by this command below
sudo /opt/lampp/lampp stop
service mysql stop
sudo /opt/lampp/lampp start
answered Mar 16 at 11:26
zouhair elhadraoui
1
1
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f763336%2fcannot-enter-phpmyadmin-as-root-mysql-5-7%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Which MySQL version?
â Rael Gugelmin Cunha
Apr 26 '16 at 18:55
Question is updated
â Mostafa Ahangarha
Apr 26 '16 at 19:04
THE SIMPLE WAY search login and pathword in /etc/mysql/debian.cnf -- Ubuntu 16.04
â cl-r
Jun 7 '17 at 22:25
Try using this: Delete root user > Add root user > Grant all privileges to root user.
â solf
Sep 8 at 13:14