正在尝试将laravel连接到localhost/phpmyadmin
我试图在我的数据库中创建表——我通过laravel模式创建的数据库,但它们没有出现在PhpMyAdmin中。我已经在我的网站上的主目录中设置了phpMyAdmin。我使用localhost/~myunsername/phpmyadmin访问php 我正在连接到Laravel的app/config/database.php中的数据库正在尝试将laravel连接到localhost/phpmyadmin,php,mysql,database,laravel,phpmyadmin,Php,Mysql,Database,Laravel,Phpmyadmin,我试图在我的数据库中创建表——我通过laravel模式创建的数据库,但它们没有出现在PhpMyAdmin中。我已经在我的网站上的主目录中设置了phpMyAdmin。我使用localhost/~myunsername/phpmyadmin访问php 我正在连接到Laravel的app/config/database.php中的数据库 'mysql' => array( 'driver' => 'mysql', 'host' => '
'mysql' => array(
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'firstapp',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
),
我正在routes.php中使用schema创建表
Route::get('/', function()
{
Schema::create('art2', function($newtable)
{
$newtable->increments('id');
$newtable->string('artist');
$newtable->string('title',500);
$newtable->text('description');
$newtable->date('created');
$newtable->boolean('alumni');
$newtable->timestamps();
});
return View::make('hello');
});
当我再次尝试运行此操作时,会出现此错误
SQLSTATE[42S01]:基表或视图已存在:1050表“art2”已存在(SQL:create tableart2
也就是说,我已经创建了这些表,但它们没有显示在PhpMyAdmin中。您是否仔细检查了在PhpMyAdmin中登录mysql的用户是否具有查看数据库和表的权限?是的,我可以登录和查看,也不会产生任何问题!我想这可能与连接到数据库时的“主机”设置有关数据库。我尝试将其更改为127.0.0.1,但没有成功。MyPhpAdmin位于我笔记本电脑上的apache站点文件夹中,并从那里运行。当连接到phpMyAdmin时,主页的右侧有一些连接信息。在“数据库服务器”区域下,“服务器”和“用户”显示什么?