I have this table on my local xampp , the table name is tags
, this works perfectly fine on my local system, but when I upload this table to my server I get the following error:
The tables I have under the table peckinga_blog
are the following:
As you can see tags
is one of them , Also for the tags
table I have the following migrations in my laravel application:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTagsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('Tags', function (Blueprint $table) {
$table->increments('id');
$table->mediumText('tag');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('Tags');
}
}
Now why am I getting this this error in spite of my database clearly being available ? What can I do so that my server will look for the database tags
instead of Tags
?
Database and table names are not case sensitive in Windows, and case sensitive in most varieties of Unix or Linux. Table names in MySQL are file system entries, so they are case insensitive if the underlying file system is.
Although after applying the migration, it should work But in case if it is not working and you want both statements i.e. lower case and upper case name in table to succeed, you need to put the following line
lower_case_table_names = 1
in your /etc/my.cnf or wherever you keep your MySQL configuration.
Doctrine generated capital/CamelCase table names and MySQL stored them as lowercase!
Or
Before export the database from local you can do these steps:
open your MySQL configuration file: [drive]\xampp\mysql\bin\my.ini
look up for: # The MySQL server [mysqld]
add this right below it: lower_case_table_names = 2
save the file and restart MySQL service
Be sure to add the system variable to [mysqld] section of the configuration file.
For more information you can check the MySQL Reference Link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With