Bioshox
Posts: 104
Joined: Sun May 27, 2012 12:18 pm
Location: Manchester, United Kingdom.
Contact: Website

phpMyAdmin

Sun May 27, 2012 12:21 pm

Hello R-pi!

I got mine yesterday and I'm fairly new to Linux, although I do have some experience, managed to get Apache, PHP and MySQL running (which I'm really pleased about)

But I've hit a few roadbumps and I'm looking for some assistance!

First being phpMyAdmin, for some strange reason it tells me it's installed fine, but when I head to 192.168.2.18/phpmyadmin i get a 404 not found, I'm running debian and here is the list of commands I've run to get it running:

Code: Select all

root@raspberrypi:~# apt-get install phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  phpmyadmin
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 0 B/4,351 kB of archives.
After this operation, 17.7 MB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously deselected package phpmyadmin.
(Reading database ... 50549 files and directories currently installed.)
Unpacking phpmyadmin (from .../phpmyadmin_4%3a3.3.7-7_all.deb) ...
Processing triggers for man-db ...
Setting up phpmyadmin (4:3.3.7-7) ...
dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

Creating config file /etc/phpmyadmin/config-db.php with new version
granting access to database phpmyadmin for phpmyadmin@localhost: success.
verifying access for phpmyadmin@localhost: success.
creating database phpmyadmin: success.
verifying database phpmyadmin exists: success.
populating database via sql...  done.
dbconfig-common: flushing administrative password
root@raspberrypi:~# service apache2 restart
Restarting web server: apache2 ... waiting service m.
root@raspberrypi:~# service mysql restart
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld ..
Checking for corrupt, not cleanly closed and upgrade needing tables..
root@raspberrypi:~#
Anybody have any assistance for me on this?

Many thanks!!
Owner of: http://www.fusionstrike.com - I make gorgeous Raspberry Pi Tutorials :)

JeremyF
Posts: 515
Joined: Wed Jan 25, 2012 9:06 pm
Contact: Website

Re: phpMyAdmin

Sun May 27, 2012 1:51 pm

I don't know much about phpyMyAdmin but I would look in your /var/www folder (or wherever your root webserver folder is) and see, well, if it's there.
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge

Stephan123
Posts: 4
Joined: Wed Feb 22, 2012 8:06 am
Contact: Website

Re: phpMyAdmin

Mon May 28, 2012 9:18 am

Hello !

In the moment i waiting for my RPi.
Unfortunately I can not directly test.
Have you tried 127.0.0.1?

Sorry for my bad English.

Yours sincerely,

Stephan

User avatar
soslug
Posts: 43
Joined: Mon May 21, 2012 12:31 pm
Location: Southend on Sea
Contact: Website Yahoo Messenger

Re: phpMyAdmin

Mon May 28, 2012 9:47 am

Debian if phpmyadmin is installed should have created a folder in /etc called funny enough phpmyadmin.

That said it is possible you are addressing phpmyadmin incorrectly try this

http://localhost/phpmyadmin

but this should be done on the browser in raspberry pi itself if this fails it is also possible but perhaps unlikely phpmyadmin is in secure mode try this.

https://localhost/phpmyadmin

or even

https://localhost:10000

hopefully one of these will get you running if not somewhere along the line is a failure you can investigate what has failed in the logs.

less /var/log/apache2/error.log

There are many logs managed by Linux and is not always straight forward to know where to look but I would start reviewing each of the error logs for apache2 mysql php and phpmyadmin only errors get written to these files, so all you have to do is fix the errors.

Hope this helps
IPFreely, to weed the network demons that dwell in them their Windows!

roryoldershaw
Posts: 27
Joined: Sun May 27, 2012 4:59 pm
Location: Lincolnshire, UK

Re: phpMyAdmin

Mon May 28, 2012 10:19 am

Create a symbolic link to the phpMyAdmin install in your web root directory.

Code: Select all

cd /var/www
ln -s /usr/share/phpmyadmin
Thanks,
Rory

KaelaStreet
Posts: 6
Joined: Mon May 28, 2012 12:08 pm

Re: phpMyAdmin

Tue May 29, 2012 12:48 pm

Bioshox wrote:Hello R-pi!

I got mine yesterday and I'm fairly new to Linux, although I do have some experience, managed to get Apache, PHP and MySQL running (which I'm really pleased about)

Snipped 4 Brevity...Many thanks!!
Are you saying you have installed php (What version) MySql( mysql5?) and Apache onto the r-pi and it runs????

KS

Bioshox
Posts: 104
Joined: Sun May 27, 2012 12:18 pm
Location: Manchester, United Kingdom.
Contact: Website

Re: phpMyAdmin

Tue May 29, 2012 3:30 pm

KaelaStreet wrote:
Bioshox wrote:Hello R-pi!

I got mine yesterday and I'm fairly new to Linux, although I do have some experience, managed to get Apache, PHP and MySQL running (which I'm really pleased about)

Snipped 4 Brevity...Many thanks!!
Are you saying you have installed php (What version) MySql( mysql5?) and Apache onto the r-pi and it runs????

KS
That is correct! You can take a look at how it's keeping up here: http://www.flowcastr.com excuse the rubbish domain, it was a spare I don't use :)

I also managed to get it running, although I can't remember the command I use now, doh!

Thanks
Owner of: http://www.fusionstrike.com - I make gorgeous Raspberry Pi Tutorials :)

unusuallyalice
Posts: 5
Joined: Sat Dec 09, 2017 4:45 pm

Re: phpMyAdmin

Sat Dec 09, 2017 4:48 pm

I'm experiencing a problem where phpmyadmin upon first install would let me select which thing to run it with and I didn't do it properly (I didn't properly select apache2) and now when I install it it doesn't give me any options to set it up. I am running the latest raspbian stretch.

tony1812
Posts: 354
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

Re: phpMyAdmin

Sun Dec 10, 2017 10:00 pm

I am not sure why so many people said the web root is /var/www, but when I install apache the web root is /var/www/html.

DirkS
Posts: 10418
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: phpMyAdmin

Sun Dec 10, 2017 10:22 pm

tony1812 wrote:
Sun Dec 10, 2017 10:00 pm
I am not sure why so many people said the web root is /var/www, but when I install apache the web root is /var/www/html.
IIRC it was /var/www with older apache versions.
Note that you're responding to a necro post. It started in 2012...

tony1812
Posts: 354
Joined: Sat Jul 15, 2017 12:40 pm
Location: Boston MA.

Re: phpMyAdmin

Mon Dec 11, 2017 5:47 pm

Ah I see , didn't pay attention of the date. :}

afedriansyah
Posts: 18
Joined: Mon Feb 26, 2018 6:32 am

Re: phpMyAdmin

Mon Feb 26, 2018 8:12 am

Hi
I've been trying to log in into phpmyadmin with root but couldn't log in and this message appears "1698 - Access denied for user 'root'@'localhost'
can somebody help me by changing configuration on the username and password ? I am running raspbian stretch
thank you

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: phpMyAdmin

Mon Feb 26, 2018 8:21 am

if it fits to your system check here
but note to use
sudo ...

afedriansyah
Posts: 18
Joined: Mon Feb 26, 2018 6:32 am

Re: phpMyAdmin

Mon Feb 26, 2018 8:40 am

I just followed the instruction based on the link you gave me earlier and suddenly the ip address for phpmyadmin became forbidden
how do i solve this now ?
thank you

fbe
Posts: 647
Joined: Thu Aug 17, 2017 9:08 pm

Re: phpMyAdmin

Mon Feb 26, 2018 5:12 pm

Does http://localhost/phpmyadmin/ in a browser on your Raspberry Pi still work?

In /etc/phpmyadmin/apache.conf did you literally insert

Code: Select all

Require ip 127.0.0.1 10.0.0.0/24
or did you replace "10.0.0.0" with something suitable to your own network?

The instructions you followed didn't mention that for security reasons you should give the root@localhost database user a password before you change the authentication from unix_socket to default (mysql_native_password). phpmyadmin doesn't allow login with empty password.

afedriansyah
Posts: 18
Joined: Mon Feb 26, 2018 6:32 am

Re: phpMyAdmin

Tue Feb 27, 2018 1:24 am

i guess its a little bit late for that. Now i have different problems. I have tried to reinstall phpmyadmin and mysql server but error 1045 and so on appear during phpmyadmin installation & uninstallation. Furthermore, there's a problem with apache2 php5 libapache2-mod-php5 during reinstallingg mysql and phpmyadmin. can somebody help me solve this problem ?
detail information would be appreciated
thank you

PS : and suddenly i can log in to phpmyadmin after the problems i mentioned above earlier. this does not make sense at all.
even though i use my own ip address of my raspberry pi but why does "local hos" appear in phpmyadmin or my ip address is the local host ?
good answers would be appreciated

fbe
Posts: 647
Joined: Thu Aug 17, 2017 9:08 pm

Re: phpMyAdmin

Tue Feb 27, 2018 3:58 pm

Debian Stretch installs MariaDB instead of MySQL (even if you ask to install MySQL). Don't worry, MariaDB is a fork of MySQL with a new name.

The Debian packages install MariaDB with a database superuser root that is not authenticated by the MariaDB server but by the operation system. You can login as root only if you are operating system user root. On the other side no password is required for root to login to MariaDB as root.

When installing phpmyadmin a database has to be created in MySQL/MariaDB. This database has to be removed, when phpmyadmin is uninstalled. The debian packages are installed with root privileges (you run "sudo apt-get install phpmyadmin") and expect that login as root without password works. Your guide advised you to setup a password for root instead. Now you're alone, because the debian scripts don't work anymore and your guide is far away... (How could he know, that you wanted to install something after this "fix" :roll:)

Php5 was used in Debian Jessi. Debian Stretch comes with php7.0.

Start over with a new Raspbian image if you can.

Install Apache2, PHP, MariaDB (MySQL)

Code: Select all

sudo apt-get install apache2 php mariadb-server mariadb-client php-mysql
Create a database superuser with password authentication

Code: Select all

sudo mysql << _EOF_
create user 'admin'@'localhost' identified by 'secret';
grant all privileges on *.* to 'admin'@'localhost' with grant option;
_EOF_
(replace secret with a strong password). Don't setup a password for database user root@localhost. Don't run mysql_secure_installation (some tutorials advise you, to do that, but if you installed MariaDB from Debian packackes it doesn't do anything useful).

Install phpmyadmin

Code: Select all

sudo apt-get install phpmyadmin
Use the admin user instead of root in PHP.

If you want to know, what's going on with root in MariaDB read /usr/share/doc/mariadb-server-10.1/README.Debian.gz section ROOT USER AUTHENTICATION VIA UNIX SOCKET.

If you understand it, you might be able to set a password for root in MariaDB but you should be aware, that you have to write the same password in plain text into a configuration file, if you want some debian scripts to work. This is not better than unix socket authentication with no password for root.

Make sudo require a password (https://www.raspberrypi.org/documentati ... ecurity.md), if you are concerned about security.

If you can't or don't want to start over login as root to MariaDB

Code: Select all

mysql -uroot -p
Then insert

Code: Select all

update mysql.user set plugin = 'unix_socket',  password = '' where user = 'root' and host = 'localhost';
flush privileges;
Open another terminal and check that

Code: Select all

sudo mysql
works. When logged in create a database superuser with password authentication

Code: Select all

create user 'admin'@'localhost' identified by 'secret';
grant all privileges on *.* to 'admin'@'localhost' with grant option;
(replace secret with a strong password). Use admin instead of root in PHP.

afedriansyah
Posts: 18
Joined: Mon Feb 26, 2018 6:32 am

Re: phpMyAdmin

Thu Mar 01, 2018 2:41 am

Thanks for the answer. I'll try it now

afedriansyah
Posts: 18
Joined: Mon Feb 26, 2018 6:32 am

Re: phpMyAdmin

Thu Mar 01, 2018 7:03 am

Hi R-pi community
I have a complicated situation here and it involves phpmyadmin.

I am designing Andon lights in my lab and I want to record the time and store the recorded time immediately when a person presses the lap button. Furthermore, when a person presses the green light, it would appear in the HMI software but I pretty got it right now. So the flow starts from a person presses the green light button and then the timer starts and when that person presses the lap button, the time will be recorded and automatically stored to phpmyadmin. I am using raspbian stretch and I am not really good at coding python. To sum this up, what I am going to do is designing Andon lights and then the lights will be displayed in HMI and how long the lights are on are recorded and automatically stored to database when a person presses the lap button.

For this case it involves only green light since it is essential.
I really need help with this
Thank you

PS: the case is a bit similar in storing lap time in stopwatch to database (phpmyadmin)

User avatar
DougieLawson
Posts: 39844
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: phpMyAdmin

Thu Mar 01, 2018 7:26 am

phpmyadmin isn't a database. MySQL or the MariaDB variant is the database. Phpmyadmin is just a web interface that allow you to control your MySQL database.

So you need to restate your question without using the word "phpmyadmin".
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Return to “Beginners”