0

Please help me with my installation of LAMP, this is my first time.

yesterday I installed Apache, PHP, and Mysql Flawlessly on my Ubuntu 16.04 LTS throught terminal. and the last thing I installed is PHPMYADMIN. After I installed it, I accidentally type my username "phpmyadmin" because Im a bit sleepy and confused and also I put some password on it. After that when I try to log-in and I to create a database, it says "No Privilege".

I also tried default "root" with and without password but cant login. so I tried to reinstall it, and also I tried to 'dpkg-reconfigure' but it give me some error message which has an option *abort, retry and etc. I also tried to purge remove all the phpmyadmin datas or files and also clear all my browsing histories aswell as my cookies. the last thing I tried is to use another and alternative database software which is 'Adminer'. after I installed the software, it didnt ask me for setup an admin account.

But when I about to use it. I cant login because I dont know what is my user? I tried 'root' with or without password but still cant login. but when I tried to log my account in phpmyadmin, I was surprised that it works and logged in. but unfortunately still cant create database and it has a dialogue like phpmyadmin : 'Access denied for user 'phpmyadmin'@'localhost'.

can someone help me through out this because, Im a bit frustrated and about to give up. :'(

  • phpmyadmin has no security mechanism of its own. It uses the parameters of the MySQL database, which you store in its configuration file called config.inc.php in the top level. – Jos Oct 4 '16 at 7:25
1

Uninsalling phpadmin will not remove accounts from the mysql database. You can do that manually, but you would have to have root access.

You can recover root access with these steps.

From the terminal stop the mysql service, then load it without grant tables. In the steps bellow the text after the $ sign is the commands you input. The text in the parenthesis are explanations and comments.

(Stop the database)

$ sudo systemctl stop mysql

(Start Mysql without loading the grant tables)

$ sudo mysqld_safe --skip-grant-tables &

(Now log into mysql as root with no password)

$ sudo mysql --user=root mysql

(Set the root's password with:)

mysql> update user set authentication_string=PASSWORD('new-password') where user='root';
mysql>flush privileges;
mysql> quit;

(Kill the safe-mode server the "$" is the prompt. Hit the "%" and press ENTER)

$ %

Cntrl+c

(Now restart the database and you're all set)

$ sudo systemctl start mysql

Review this answer for details:
mysql don't ask for root password when installing

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.