skip to Main Content

I upgrade laravel to 5.8 from 5.3 using laravelshift one step at a time and tested each upgrade e.g

  • Upgrade to 5.4, tested
  • Upgrade to 5.5, tested
  • Upgrade to 5.8, tested

but when I deploy it on the server, Linode Server with Cpanel setup, and I select php7.2 in the Mutiphp Manager for this website.

Now this works perfect on local envoirnment in homestead, but on live I get the the db error ‘Access denied for user ‘homestead’@’localhost’ (using password: YES)’.

I also tried to connect to DB using mysql command line tool, and it works using the same password. I also changed the password in cpanel and try with new password. nothing is working.

4

Answers


  1. Chosen as BEST ANSWER

    Changing the password to something simpler e.g only numbers & numeric characters no special characters like # or ( etc worked for me.

    The complex password which include special characters worked for me using the mysql tool in command line, but would through error when I run php artisan install or run my code in browser http://my-project.dev


  2. you may not have homestead named database in your server. Create database first and then try to connect.

    Login or Signup to reply.
  3. I had the same issue when i first used mariadb, maybe, this article keeps the solution for your problem.

    Look here: https://superuser.com/questions/603026/mysql-how-to-fix-access-denied-for-user-rootlocalhost

    Login or Signup to reply.
  4. Even though OP has found a solution by using a password without special characters the real reason for this issue is Laravel 5.8 uses the new phpdotenv package which treats # symbol as start of comment.

    From Laravel 5.8 upgrade guide.

    the # character in an unquoted value will now be considered a comment instead of part of the value.

    To preserve the previous behavior, you may wrap the environment values in quotes:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search