72245

SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using pas

Question:

I'm on a Ubuntu 15.10 Yosemite using Laravel 5.2.*

Here is my .env file:

DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=Pastry DB_USERNAME=root DB_PASSWORD=243320

app\config\database.php

'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'Pastry'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', '243320'), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'engine' => null, ],

emember when I got the message:

<blockquote>

SQLSTATE[28000] [1045] Access denied for user 'homestead'@'localhost' (using password: YES)

</blockquote>

Help me please!

Answer1:

First glance conclusion: The app you're trying to load in the browser is not using the info in the .env and database.php files you're looking at.

Are you accessing the correct URL? Aren't you trying to access a vanilla Laravel installation in a different folder? A fresh install of 5.2 has homestead as username.

Check your url Check your virtualHost directory. Is the correct path used?

Answer2:

Thank you for your guidance. I do not have access to the database. But the construction of migrations was run properly. But I can not run it for a test run:

public function index() { $com = new Categorys(); $com->name = 'ali'; $com->ename = 'hi'; $com->img = 'sdjf'; $com->save(); // return View('category.index'); }

Recommend

  • javascript caesar cipher algorithm [closed]
  • How to use variables from a controller in another controller in AngularJS
  • Javascript Appending to 2-D Array
  • passing objects from the global scope to a model
  • How to get Row Number when insert records from File to DB with LOAD DATA LOCAL INFILE, Transaction a
  • How to save the path of the SQLite image and then retrieve it?
  • Trigger data response from .aspx page
  • remove quotes from json_encode keys
  • Pagination display error using mysqli
  • Password Authentication - Inconsistent Hashes
  • Connect laravel jenssegers to mongodb atlas cluster
  • jQuery + Fancybox trigger error on Internet Explorer 8
  • How to store emoji string in Database using Laravel with Orm Query
  • Can't connect to MySQL on live with Laravel 5
  • Constraint to add more space between two UIViews
  • Fatal error: Call to a member function bind_param() on boolean [duplicate]
  • Laravel 5.1 - Connecting to MySQL Database (MAMP)
  • Foreach loop using string to output XML
  • MySQLi using an IN in a where
  • How to run a set of SQL queries from a file, in PHP?
  • Android NFC read Tags issue. Activity starts each time on data received
  • openssl handshake failed
  • How to resolve docker host names (/etc/hosts) in containers
  • CORS with socket.io
  • mave 3.2 not able to access local nexus instance return 502 code
  • Tomcat memory Leak
  • JBoss External Properties Files in Classpath
  • htaccess add www if not subdomain, if subdomain remove www
  • MongoError: Incorrect arguments
  • Django rest serializer Breaks when data exists
  • Cannot resolve symbol 'MyApi'
  • Jenkins: How To Build multiple projects from a TFS repository?
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • Codeigniter doesn't let me update entry, because some fields must be unique
  • Getting error when using KSoap library to consume .NET web services
  • need help with bizarre java.net.HttpURLConnection behavior
  • Authorize attributes not working in MVC 4
  • How can i traverse a binary tree from right to left in java?
  • UserPrincipal.Current returns apppool on IIS