phpMyAdmin cannot running after editing .env document - database

enter image description hereWhen I tried to get in phpmyadmin page this is what I got. After edit .env document in visual studio code with db_name and php artisan config:clear. Before this action, phpMyAdmin is running as usual.[phpMyAdmin fatal error][2]

Related

Artisan says database not found

I'm working on a brand new laravel application for learning laravel.
I've done the following (I'm following this tutorial):
Created new application using laravel new test_project_2
Setup the .env file
Created a database called laravel
Run php artisan migrate
This is my .env file:
This is what I get:
As you can see, I can use the "laravel" database perfectly well when I'm logged into Mariadb via terminal. The website also renders absolutely fine. I did run the SQL command - SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE' but I got the message ERROR 1054 (42S22): Unknown column 'laravel' in 'where clause'
Note - I've worked on other dummy laravel projects last week and didn't face any problems, although admittedly I'm not sure if I ran the php artisan migrate command for those (wasn't required, but I might have run it just cause I kept seeing it).
Why is this problem happening?
How do I fix it?
Run the below command and try migrate command
php artisan cache:clear
php artisan config:clear
can you try creating your database with below and then try migration.
mysql -u root -p
create database [DB name];
use [DB name];
Then do migration:
php artisan migrate
Also make sure you have entered correct database name & credential.
Solved this by changing the DB_HOST values from 127.0.0.1 to localhost.
Anyone know why this works? Beats the heck out of me.

wamp phpinfo shows sqlsrv but phpinfo inside artisan server not showing sqlsrv drivers

I am using Apache 2.4.23 and Php 7.0.10 and Laravel 5.4.
I have installed sqlsrv and it's pdo file inside 'C:\wamp64\bin\php\php7.0.10' directory.
So when I created and test.php file in the www directory and executed it I got the following info.
The PDO Information
the SQLSRV info:
But when I start php artisan serve and execute phpinfo() then I didn't get the SQL drivers.
PDO extensions:
Drives SQL
So when I try to connect to SQL db I am getting this error.
QueryException in Connection.php line 647:
could not find driver (SQL: SELECT TOP 5 ......
Any help will be appreciated.
Thanks
WAMPServer has 2 php.ini files. If you want to add the SQLServer extension for use from the command line CLI then you must manually edit the
c:\wamp\bin\php\php7.0.10\php.ini
and add the new extension line
The extension dll's should be placed in the
c:\wamp\bin\php\php7.0.10\ext
folder.

Error in installing theme in Drupal 7

I get the following error while installing a theme in Drupal 7 by URL input at theme install form :
Failed to connect to the server. The server reports the following message:
Cannot connect to FTP Server, check settings
For more help installing or updating code on your server, see the handbook.
What might be the problem?
Where am I going wrong?
Installing theme by downloading and putting it into sites/all/themes everytime is annoying.
The following code worked for me,
sudo chown www-data:www-data -R /var/www/drupal(or your drupal web root name)/sites

Easy way to push postgres db to heroku in Win7? problems with db:pull and pg:transfer

Using Rails 3.2.2, finishing up my migration from sqlite to postgres 9.2.
Used answer in this tutorial as a guide to install postgres and got stuck on Step 11 where it asks run heroku db:pull where I get:
Failed to connect to database: Sequel::AdapterNotFound -> LoadError: cannot load such file --pg
I dug deeper and found db:pull (taps gem) is deprecated and came across a few recommendations for pg:transfer. Installed pg:transfer, but I get the impression it may be *nix only(?) as if I run: heroku pg:transfer it returns:
Heroku client internal error. No such file or directory - .env (Errno:ENOENT)
If I do pg:transfer with -f and -t it gives me:
'env' is not recognized as an internal or external command, operable program or batch file which means it isn't bound to path or doesn't exist as a command in windows.
Any thoughts on above errors?
Resolved by using pg:backups gem, which was recommended as the replacement for taps in the Heroku docs. I used this guide and uploaded my dump to dropbox for Heroku to pick it up.
Here's my exact list of steps and cmds:
Added pgbackups from heroku.com add-ons to my instance.
heroku pgbackups:capture DATABASE (this just backs up your heroku db)
pg_dump -h localhost -U <pg username> -Fc dbname > dbname.dump
Moved dbname.dump into a folder on my dropbox
In Dropbox, right-click on dbname.dump => "Share link"
Cancel the sharing dialogue pop-up, right-click on "Download button", Copy Link Address (Chrome)
heroku pgbackups:restore DATABASE <paste dropbox download link here>
Dropbox trickiness: don't use the file link provided by Dropbox since it's an html redirect and will cause pg:restore to fail, even though the extension ends in .dump
Instead, navigate to your dropbox page and "right-click copy link address" on the Download button. That's the address you use in your pgbackups:restore (should be something like db.dump?token=<long random string>)
A bit clunky, but got the job done. If you know a better way please let me know!
You need to make a .env file containing something like:
DATABASE_URL=postgres://localhost/myapp_development
References:
https://github.com/ddollar/heroku-pg-transfer
https://devcenter.heroku.com/articles/config-vars#local-setup

Mysql error when using Cake Bake

H,
I am a newbie to cake php. So there is a problem i'm facing with.
I have installed XAMPP and my cakephp project folder lies in htdocs(/opt/lampp/htdocs/cakephp). When I start cake bake by the command /.cake bake, I am getting a mysql error as below.
enter code here
PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /opt/lampp/htdocs/cakephp/cake/libs/model/datasources/dbo/dbo_mysql.php on line 552
can u help me?
Check if you have MySQL installed properly.
With XAMPP normally get this error.
You can do two things to solve it:
A clean installation of Apache + PHP + MySQL
If you're on a linux or on a mac you can create a symbolic link to the socket:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
Where /tmp/ is your XAMPP mysql folder (e.g. /opt/lampp/var/mysql/mysql.sock)

Resources