As mentioned by others (Ref 1,
Ref 2 and Ref 3) the current phpMyAdmin version (4.8.2) + MySQL 8.0.11 + PHP 7.2.8 doesn't work as expected.
The error happens when you try to open phpMyAdmin, where it shows an error message:
#2054 - The server requested authentication method unknown to the client
mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
mysqli_real_connect(): (HY000/2054): The server requested authentication method unknown to the client
As stated in MySQL migration manual here, and described as the solution in Ref 2, you can correct this by executing the following mysql query inside docker:
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'ROOTPASSWORD';
(In order to run this, I use docker exec -it CONTAINERID bash and execute mysql command)
And it works. The main problem is that I need to fire this query as soon as the container starts (the current method is manual and far from scalable). I assume it's possible in different ways:
By executing a PHP script that runs the query after everything has been setup (IMO this is unsafe )
By running the above command in a bash after everything has been setup
The first one is unsafe IMO as the mysql user must have high privileges, although there will be only the root user when this script runs. I haven't tested it yet.
The seconde one is the best IMO, but I can't figure it out how to implement using Dockerfile, as everything I type there runs BEFORE mysql and phpMyAdmin are installed. How could I achieve that?
My current Dockerfile can be seen here and the docker-compose.yml can be seen here.
As a simple solution, you can build your custom mysql image and run the command there. Then mysql will start with this modification already in place.
Related
When trying to access my Laravel website I'm getting an SQL connection refused error when trying to execute $candidate = App\Models\Candidate::find(400);
SQLSTATE[HY000] [1698] Access denied for user 'root'#'localhost' (SQL: select * from `candidates` where `candidates`.`candid` = 400 limit 1)
However, I can connect fine using php artisan tinker from the command line:
root#454ab4403b8f:/app# php artisan tinker
Psy Shell v0.9.6 (PHP 7.2.7-1+ubuntu18.04.1+deb.sury.org+1 — cli) by Justin Hileman
>>> App\Models\Candidate::find(400)
=> App\Models\Candidate {#2865
candid: 400,
firstname: "",
...
}
Is there a different configuration for artisan than web? Why would one be working but not the other?
The ROOT account on a MySQL database is usually blocked for login that is not console. Artisan is console and your user is recognised.
Just make in your database a dedicated database and database user for your development purposes.
And never use root for web applications. Always make a dedicated user for databases and such. Root has too much power, and some errors that would possibly pop up on a normal user won't pop up under root which could lead to unexpected bugs when moving to production. In your local environment you wish to mimic production as close as possible, with all the same limitations.
Also if your website would end up with a weakness and on production you also use ROOT as database user, then if a hacker found the weakness the hacker could read/modify/wipe all the data in all your databases and possibly have access to your filesystem and gather other files that way. Just never use root except to configure the database.
I am running osTicket on server and now i need to migrate the server. So i took backup of files and database on my localhost and trying to run it for test but it is giving me error of 500 and descripton is
PHP Fatal error: Can't inherit abstract function AuthenticatedUser::getId() (previously declared abstract in BaseAuthenticatedUser) in /var/www/html/ostickets/upload/include/class.auth.php on line 26
I am testing it on local so that after successful migration i don't want to loose any of my data. please guide.
It is pretty simple, once you've installed the same version of OSTicket in your new server, you just need to migrate the database.
From terminal:
mysql -u root -p ost_db < [PATH TO YOU OSTicket DB BACKUP FILE]/ost_db.sql
Have a great day!
im trying to install Sylius with composer for an e commerce project however i just cant get it done..i follow the docs but i always get an other error when i fix one.
already fixed some errors eg. incl extension exception, paypal bundle renaming issues on git and memory size problem.
Now where im stuck:
When i fill the parameters with the interactive script
if i give any password for the database i get this:
Doctrine\DBAL\Driver\PDOException
Acces denied for user 'root'#localhost
if i dont give password then i get this:
Doctrine\DBAL\Driver\PDOException
SQLSTATE[HY000]Unknown database databasename_dev (it appends _dev prefix)
then in both cases it ends up with this: RunTimeException
An error occured when executing the ""cache:clear --no-warmup"" command
and the proccess is terminated with this exception..
i tried if i could continue with the $ cd acme
$ php app/console sylius:install commands but:
if i gave a password then get acces denied Doctrine\DBAL\Exception\ConnectionException
if didnt then Doctrine\DBAL\Driver\PDOException
SQLSTATE[HY000]Unknown database databasename_dev
i created the database manually which seems to solve the problem however get this: General error: 1007 cant create database databasename_dev; database exists
(i dont think this solution is the right one)
but after this it doesnt terminate yet and creates the database schema and then after some installation it terminates with this:
RuntimeException
The source file "C:\Users\user\acme\app/../web/bundles/cmfcreate/vendor/create/themes/midgard-tags/tags.css" does not exists
i checked the page if it may useable but got twig exception that currency not found and many components are missing from the page..
What's your workspace?
If you work on Windows with WAMP I'll give you some things to check :
set the database port to : 3306
create a new user for the database, juste for your sylius project
when you run create-project commande, in databaseport write : localhost
I hope it helps you.
I have a database file on my computer called testing.sqlite, which contains a copy of me database that I want to use for testing (rather than connecting to my ordinary MySQL production server).
I created an entry in the config/database file in laravel as instructed, setting it to access the sqlite file, and it all look right. But when I try and actually do anything, I get the error message:
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database (SQL: select * from sqlite_master where type = 'table' and name = vendor_alerts)
I can access the file using sqlite testing.sqlite from the command line, why can't laravel read it?
The problem is that the version of sqlite is different. Laravel uses sqlite3, wheareas the sqlite command on your console might be an earlier version. Run sqlite -version from the command line to check your version - is is probably 2 something. You need to install sqlite3, and you'll find that it is not compatible - i.e. sqlite3 testing.sqlite will produce the same error you are getting from laravel.
So, upgrade your command line sqlite version, and copy the data into a new sqlite3 database, and laravel will work without trouble.
I'm completely new to the Akelos framework, but I am familiar with PHP. When I came across the framework I knew it was exactly what I was looking for but for the life of me I cannot get it to install properly.
Here are the steps that I went through and the details of my environment:
I am on a Mac Intel, using MAMP as my main environment
I have copied the Akelos files into my project folder.
When I navigate to localhost:8888 (as setup by mamp) I first get this error message:
(Warning) Cannot modify header
information - headers already sent by
(output started at
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/public/index.php:50)
But when I refreshed the page that warning disappears and I successfully obtain the Akelos Getting Started page
I setup the database configuration, and proceed
I successfully set the language settings
First I get the following error:
(User Error) Could not create or alter
table akelos_migrations using the SQL
CREATE TABLE akelos_migrations ( id
INTEGER NOT NULL AUTO_INCREMENT, name
VARCHAR(255), version
INTEGER, updated_at
DATETIME, created_at
DATETIME,
PRIMARY KEY (id) )TYPE=InnoDB
When I refresh - everything "appears" to work fine and I am taken to to the "Welcome Aboard" page
When I try to run Script / Generate I get the following message:
Warning: mysql_connect(): [2002] No
such file or directory (trying to
connect via
unix:///var/mysql/mysql.sock) in
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/vendor/adodb/drivers/adodb-mysql.inc.php
on line 353
Warning: mysql_connect(): No such file
or directory in
/Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/vendor/adodb/drivers/adodb-mysql.inc.php
on line 353
Fatal error: Connection to the
database failed.
mysqlt://salman:******#localhost/socialPM_dev
in /Users/Salman/Work/_PERSONAL
PROJECTS/Web
Development/PHP_Development/SPM/lib/AkActiveRecord/AkDbAdapter.php
on line 66
This happens even if I try to manually create the akelos_migrations table using phpMyAdmin and SQL.
I would love to be able to use this framework - but I absolutely can't get past this!
Well the mysql socket file isnt usually in /var/mysql/mysql.sock on OS X. If you use the Mysql install from Mysql then its in /tmp/mysql.sock by default... The macports version is in /opt/local/var/run/mysql5/mysqld.sock by default. Im not sure where it is in MAMP because i dont use it, but my guess would be somewhere on the MAMP folder structure. You need to find out where it creates its socket and supply the path to it to your conifguration (i assume thats an option on the DB setup screen).