Lost Laravel admin password - laravel

Trying to find way to generate a new password while I don't have a reset-password form.
I already tried to copy/paste encrypted value from another database but it still says:
These credentials do not match our records.

Just found a quickest solution. You can change any user password via command line with tinker:
php artisan tinker
$u =App\User::find(1)
$u->password=bcrypt('newpassword')
$u->save()

Related

Laravel - Moved project now can't login

I have an existing Laravel 5.6 project, I have moved it over to a new Bitnami WAMP installation.
I have migrated the database and seeded it so it contains my user account, but whenever I attempt to log in I get the following error..
these credentials do not match our records
I have confirmed the password is correct and that it can access the database, is there anything else I should be checking?
I am leaning towards it being a configuration issue with the Bitnami install but am slightly lost on where to be checking.
Change .env file, DB name, DB user name And DB Password
composer update
php artisan key:generate

Issues when trying to migrate

I am having a problem when trying to make migrate.
MY DATABASE DOES NOT RECEIVE NEW MIGRATION, NO NEW FILES NO UPDATES
From my project;
I do:
php artisan migrate
But nothing shows in my database, I already verify my database and my file .env
Both are correct.
I know you said you verified it, but please check again that the correct database information is entered in your .env file. It should be something like the following for a dev environment:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
You need to edit that data if you haven't and make sure it's correct. You also need to make sure that your database actually exists.
Also make sure you're actually entering the correct command. The general way you should making migrations is:
php artisan make:migration create_example_table --create=example
After that, run
php artisan migrate
Lastly, are you getting any errors in the console? If so, you need to edit your post and post them here.
firts thanks for answering
I had already checked .env file and I replaced database name from my sql (I use phpadmin), and also I changed username and password as I entered on sql server, but there is no migration
I had created a new table using artisan command (besides I have a users table that comes when downloading laravel project). After creating this new table I expected to upload this new one to my database located in sql server, but nothing happen
it shows your users yable already exists, mentions my users tables and not my new table that i just created. It is weird bcz it does not EVEN upload any changes made in default table users.....always answer your table users already exits

Laravel 5.2 How to authenticate with a real mysql database

I'm new with laravel, I read the documentation of laravel, but I don't know how I make an authentication with a real mysql database.
I mean, I see that there is a php migration command, but it makes a table in php and not in my database right ?
Actually, I have a mysql database with a user table with login and password.
I'm lost with this framework, because I never used a php framework.
Thanks !!
Edit :
Excuse me, I misspoke and my problem has evolved, how did you to authenticate with a user table already exists in the database by using the Authentication service?
in .env or config>database.php you can set your database and related database connections configurations
after that create migrations and run them it will create database tables in your database as per your .env or config>database.php database configurations.
I think you might need to read again Laravel documentations.
Try the following.
Make sure you have a database create in your MySql.
Check again your .env for: database_host, database_name, database_user, database_password - make sure you have the right
Try bellow code on your route.php
Route::get('/', function () {
if(DB::connection()->getDatabaseName())
{
echo "Yes! successfully connected to the DB: " . DB::connection()->getDatabaseName();
}
});
If above is successful your migration should work.

Laravel : "mcrypt_decrypt(): The IV parameter must be as long as the blocksize"

I ran composer update on a Laravel application, and now I am getting this error:
mcrypt_decrypt(): The IV parameter must be as long as the blocksize
What happened?!
I figured this out. All you have to do is clear your cookies, and everything will be A-okay!
You need to change your cipher at app\config\app.php. Having same cipher name was causing that problem for me. I changed the cipher name uniquely & then it worked fine.
This problem can also happen when you run more than one Laravel project/app with same Encryption Key. Just change key value in app/config/app.php with different value and you ready to go.
Just elaborating on the answer from Ifan Iqbal. As he says this happens when running several Laravel installations with the same encryption key. Instead of clearing your cookies, simply create a unique key for each Laravel install you run (good practice by the way).
Go to your terminal and put:
php artisan key:generate
This will automatically set the encryption key in app/config/app.php and your error will go away.

Cannot log into xampp

Is there a way to find your old user name and password for xampp if you have lost it? Also, the xampp server says 'xampp user; does that mean that 'xampp user' is the user name?
Alternately, is there a way to rest the username and password, if the originals cannot be recovered?
Old question but here's the answer, as I recently got stuck with this:
go to \xampp\security and delete xamppdirpasswd.txt, then replace the contents of xampp.users with just 'user'. Now refresh on localhost and you should be prompted for username and password where you just need to enter 'user' and no password.
Then go to http://[localhost]/security/xamppsecurity.php and set a new one!
I think the only way is to manually set new password and/or username.
There is a post on Stacowerflow already which explains quite well how to do it:
Go to your xampp\mysql\bin\ folder
Edit my.ini and insert skip-grant-tables below [mysqld]
Restart MySQL
Set new password for your root user by running UPDATE mysql.user SET
Password=PASSWORD('new_password') WHERE User='root' in phpMyAdmin in
the mysql database (or just leave it like this if MySQL cannot be
accessed from remote hosts)
Original post

Resources