Комментарии:
great job thank you. I have ONE QUESTION PLEASE. is it possible to connect one Application to two Databases? thx
ОтветитьHow can ANYBODY justify giving this guy a thumbs down? Absolutely nobody does it better than him!
ОтветитьI salute you
ОтветитьIt doesn't work in version 7.1
ОтветитьDid posts table get there automatically from doing that migration or is that from model Post?
ОтветитьI see picture for last video but i can't click it
ОтветитьWhen I am doing php artisan migrate, I am getting this error:
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No connection co
uld be made because the target machine actively refused it.
(SQL: select * from information_schema.tables where table_schema = blog and tab
le_name = migrations)
at C:\wamp64\www\57\vendor\laravel\framework\src\Illuminate\Database\Connectio
n.php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[HY000] [2002] No connection could be made because
the target machine actively refused it.
")
C:\wamp64\www\57\vendor\laravel\framework\src\Illuminate\Database\Connecto
rs\Connector.php:70
2 PDO::__construct("mysql:host=localhost;port=8000;dbname=blog", "root", "",
[])
C:\wamp64\www\57\vendor\laravel\framework\src\Illuminate\Database\Connecto
rs\Connector.php:70
Please use the argument -v to see more details.
I am using laravel 5.7.14 and wamp server, please help me to get out of this error. Thank you so much in advance.
Please help!!
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)
after I run php artisan migration
I use XAMPP....but everytime one table is created, no more!!
please help THX
syntax error, unexpected '$post' (T_VARIABLE), expecting ')'
Ответитьhey, i am using xampp in windows, can you help me to set up database through that
ОтветитьI have been trying to migrate but it keeps me giving this error
Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = blog_demo and table_name = migrations)
And it says connection refused. Whats the problem here?
Those who are facing error during migration access violation 1071 too long. use the following code
after first
use Illuminate\Support\Facades\Schema;
after that paste
Schema::defaultStringLength(191);
inside boot method
I have this err , and i try all slotions and nothing work,
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table `users` add unique `users_email_unique`(`email`))
at C:\Users\fauzia hariri\Desktop\Sites\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:665
661| // If an exception occurs when attempting to run a query, we'll format the error
662| // message to include the bindings with SQL, which will make this exception a
663| // lot more helpful to the developer instead of just the database's errors.
664| catch (Exception $e) {
> 665| throw new QueryException(
666| $query, $this->prepareBindings($bindings), $e
667| );
668| }
669|
Exception trace:
1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes")
C:\Users\fauzia hariri\Desktop\Sites\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:459
2 PDOStatement::execute()
C:\Users\fauzia hariri\Desktop\Sites\blog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:459
Please use the argument -v to see more details.
why is it that there is an error when I migrate the error is something like this " Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access
violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: a
lter table `users` add unique `users_email_unique`(`email`))
at C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Conne
ction.php:664
660| // If an exception occurs when attempting to run a query, we'll
format the error
661| // message to include the bindings with SQL, which will make th
is exception a
662| // lot more helpful to the developer instead of just the databa
se's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Sp
ecified key was too long; max key length is 767 bytes")
C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Conn
ection.php:458
2 PDOStatement::execute()
C:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Database\Conn
ection.php:458
Please use the argument -v to see more details.
sir what is 'forge' in the database.php ///// 'database' => env('DB_DATABASE', 'forge'),
ОтветитьFor those who use laravel 5.6.16 go in migrations and in the email use a number of varchar inferior to 250 and the problem of long value will be fixed
ОтветитьI love you, man! :D
ОтветитьThank you so much for making these videos :)
ОтветитьXAMPP is a great way of running MySQL on Windows, and I think you might even get MySQLAdmin included. You will need to have Apache launched for that to work too though.
ОтветитьIf You Are facing problem in laravel 5.4 , like Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes ,then Do this :
1.Go to AppServiceProvider.php , which is inside. App->Auth->Provider.
2.Then Add use Illuminate\Support\Facades\Schema; on Top
3.and inside Boot() add this , Schema::defaultStringLength(119);
Problem Solved
if not solved by the above solution
then try this
in database.php
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
Part 9: Migration Basics
php artisan make:model Post --migration
Go to : database\migrations\2017_12_11_131619_create_prosts_table.php
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->string('title');
$table->string('body');
$table->timestamps();
});
}
** Create a Database and Write it into in .env **
php artisan migrate
this guy deserves more likes and subscribers
Ответить[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Providers\ServiceProvider' not found
How to solve this error in laravel 5.5
wtf ...everything was going great and u couldnt use workstation that could be used by everyone...!!
ОтветитьIf you have problems - Maybe this will help:
When you install mysql it will give you a temporary password, which will expire.
First off all check if you can run mysql through terminal, by writing: mysql
If not then write: export PATH=$PATH:/usr/local/mysql/bin
Now you can write: mysql -u root -p and then: SET PASSWORD = PASSWORD(’some-password’);
And connect with sequel pro using your new password.
And now it works! Don’t know exactly why.. But it does :)
I’ve got a lot of problems getting mysql to work and i’ve just been using MAMP.
awesome mate
ОтветитьIs there any simple way to add a new column to a database table without making an additional migration? I want to update the existing migration and run a command like "migration-update"? Does anybody have an idea for me?
Ответитьhey please help me to configure MAMP because I am getting an error saying Database [MAMP] not configured
Ответитьyou are awesome tutorial teacher i have ever watached teaching each and everythings vividly tq so much sir
Ответитьofficially stuck on this version of the blog and the advanced version.... i follow the steps exactly but some erors happen, please help with errors to continue with tutorials
ОтветитьWhen I tried to start migration I received an error:
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 107
1 Specified key was too long; max key length is 1000 b
ytes (SQL: alter table `password_resets` add index `pa
ssword_resets_email_index`(`email`))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 107
1 Specified key was too long; max key length is 1000 b
ytes
Later I just updated info here: config\database.php
Changed to: 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci'
From: 'charset' => 'utf8m4b', 'collation' => 'utf84b_unicode_ci'
Is this change going to be crucial for upcoming work? Thanks!
Not sure? Try first $mysql --version, to check if you have it already installed.
ОтветитьC:\xampp\htdocs\laravel>php artisan migrate
Migration table created successfully.
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ
L: alter table `users` add unique `users_email_unique`(`email`))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
THIS ERR OCCURED .MIGRATION AND USER table is created but not the post table.i am doing in the xampp
Using MAMP? Write localhost:8889 at the .env - Took me a while to figure out.
Ответитьbroo bro when i use php artisan make:model Post --migration
its makes one file in app the name of this file is Post.php but other file is not created in the migration folder
please guide me waiting for your response
No offense, but too much wasted time. If you want to learn someone to use Laravel, there is no need to learn them how to use SQL databases and how-to install different shit. Laravel, and any of PHP frameworks out there, are reserved for the people who already KNOW how to code. Frameworks are not for beginners in any programming language cause they need to learn to code from the ground up, and build their own logic. Making this kind of videos, you are basically damaging young people wishing to become developers one day. For the devs out there trying to use your tutorials, it's all in fast forwarding the boring and not related parts. So, make up your mind. Teaching somebody to use Laravel or to be a PHP developer. Totally two different things.
Ответитьreally I do not have any Idie to say thank you
thank you for every word
Just use XAMPP! It's by far the easiest way!
ОтветитьFor those who had an error: Syntax error or access violation: 1071
Go to app->Providers->AppServiceProvider.php in the AppServiceProved.php there is a method boot(), copy this in it and the error should be fixed: Schema::defaultStringLength(191);
Thanks alot for all your videos!! You are really great at explaining things and managed to clarify alot of things in my head ( been learning web dev for a year and a half now and sometimes it gets overwhelming)
I got an error when trying the migrate command while exercising on this video, but i managed to fix it. So here's what to do if you get this error
$php artisan migrate
Migration table created successfully.
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQ
L: alter table `users` add unique `users_email_unique`(`email`))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes.
- Go to [project]/app/Providers/AppServiceProvider.php
- Make sure you add use Illuminate\Support\Facades\Schema right after use Illuminate\Support\ServiceProvider;
- Add Schema::defaultStringLength(191); into the public function boot()
Now, if you already got the error, some of the tables might've been created. What I did was dropping those, and reused the php artisan migrate command and voila ! It all works perfectly
If You Are facing problem in laravel 5.4 , like Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes ,then Do this :
1.Go to AppServiceProvider.php , which is inside. App->Auth->Provider.
2.Then Add use Illuminate\Support\Facades\Schema; on Top
3.and inside Boot() add this , Schema::defaultStringLength(119);
Problem Solved
Error in lartavel 5.4 windows
: [Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Solution : Check my below comment
It was fun learning until I just hit this db errors. I can't seem to resolve it. Anyone want to help? I really want to be able to keep going :/ .. Error is long, and in two parts, in red box. First one: [illuminate/database/queryexception], SQLState[42501]: Base table or view already exists: 1050 users already exists. (Sql create table users 'id' int unassigned not null auto increment primary key, 'name' varcar 255.... etc... Second red box: [PDO Exception] , [SQLstate[42501]; Base table or view already exiss. 1050 users already exists. -- That's what it says. And when I look at sequel pro I can see users and migrations but not the other two as you have here. Thanks!
Ответить